home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1991-05-23 | 13.3 KB | [TEXT/MPS ] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
Confidence | Program | Detection | Match Type | Support
|
---|
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, inited, Thu May 23 14:40:29 1991, modified Thu May 23 14:40:29 1991, creator 'MPS ', type ASCII, 12956 bytes "manpage" , at 0x331c 382 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [MPS ] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 07 6d 61 6e 70 61 67 | 65 00 00 00 00 00 00 00 |..manpag|e.......|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 01 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 32 9c 00 | 00 01 7e a4 61 bd 1d a4 |.....2..|..~.a...|
|00000060| 61 bd 1d 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |a.......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 05 64 00 00 |........|.....d..|
|00000080| 4e 41 4d 45 0d 20 20 20 | 20 20 43 61 6d 6c 63 2c |NAME. | Camlc,|
|00000090| 20 43 61 6d 6c 20 2d 20 | 54 68 65 20 43 41 4d 4c | Caml - |The CAML|
|000000a0| 20 4c 69 67 68 74 20 63 | 6f 6d 70 69 6c 65 72 20 | Light c|ompiler |
|000000b0| 61 6e 64 20 74 6f 70 6c | 65 76 65 6c 20 73 79 73 |and topl|evel sys|
|000000c0| 74 65 6d 0d 0d 0d 0d 53 | 59 4e 4f 50 53 49 53 0d |tem....S|YNOPSIS.|
|000000d0| 20 20 20 20 20 43 61 6d | 6c 20 5b 2d 49 20 6c 69 | Cam|l [-I li|
|000000e0| 62 2d 64 69 72 5d 20 5b | 2d 4f 20 6d 6f 64 75 6c |b-dir] [|-O modul|
|000000f0| 65 2d 73 65 74 5d 0d 20 | 20 20 20 20 43 61 6d 6c |e-set]. | Caml|
|00000100| 63 20 5b 2d 63 5d 20 20 | 5b 2d 6f 20 20 65 78 65 |c [-c] |[-o exe|
|00000110| 63 2d 66 69 6c 65 5d 20 | 20 5b 2d 49 20 20 6c 69 |c-file] | [-I li|
|00000120| 62 2d 64 69 72 5d 20 20 | 5b 2d 4f 20 20 6d 6f 64 |b-dir] |[-O mod|
|00000130| 75 6c 65 2d 73 65 74 5d | 0d 20 20 20 20 20 66 69 |ule-set]|. fi|
|00000140| 6c 65 6e 61 6d 65 20 2e | 2e 2e 0d 0d 0d 0d 44 45 |lename .|......DE|
|00000150| 53 43 52 49 50 54 49 4f | 4e 0d 20 20 20 20 20 54 |SCRIPTIO|N. T|
|00000160| 68 69 73 20 69 73 20 61 | 6e 20 69 6d 70 6c 65 6d |his is a|n implem|
|00000170| 65 6e 74 61 74 69 6f 6e | 20 6f 66 20 43 41 4d 4c |entation| of CAML|
|00000180| 20 4c 69 67 68 74 2c 20 | 61 20 20 73 69 6d 70 6c | Light, |a simpl|
|00000190| 69 66 69 65 64 20 20 76 | 65 72 2d 0d 20 20 20 20 |ified v|er-. |
|000001a0| 20 73 69 6f 6e 20 6f 66 | 20 74 68 65 20 43 41 4d | sion of| the CAM|
|000001b0| 4c 20 6c 61 6e 67 75 61 | 67 65 2e 0d 0d 20 20 20 |L langua|ge... |
|000001c0| 20 20 43 41 4d 4c 20 4c | 69 67 68 74 20 63 61 6e | CAML L|ight can|
|000001d0| 20 62 65 20 75 73 65 64 | 20 69 6e 74 65 72 61 63 | be used| interac|
|000001e0| 74 69 76 65 6c 79 2c 20 | 20 74 68 72 6f 75 67 68 |tively, | through|
|000001f0| 20 20 61 20 20 4c 69 73 | 70 2d 6c 69 6b 65 0d 20 | a Lis|p-like. |
|00000200| 20 20 20 20 74 6f 70 6c | 65 76 65 6c 20 20 6c 6f | topl|evel lo|
|00000210| 6f 70 2e 20 20 20 54 68 | 69 73 20 20 63 6f 72 72 |op. Th|is corr|
|00000220| 65 73 70 6f 6e 64 73 20 | 20 74 6f 20 20 74 68 65 |esponds | to the|
|00000230| 20 20 60 43 61 6d 6c 27 | 20 63 6f 6d 6d 61 6e 64 | `Caml'| command|
|00000240| 0d 20 20 20 20 20 28 66 | 69 72 73 74 20 66 6f 72 |. (f|irst for|
|00000250| 6d 20 61 62 6f 76 65 29 | 2e 20 49 6e 20 74 68 69 |m above)|. In thi|
|00000260| 73 20 6d 6f 64 65 2c 20 | 69 74 20 72 65 61 64 73 |s mode, |it reads|
|00000270| 20 70 68 72 61 73 65 73 | 20 6f 6e 20 20 73 74 61 | phrases| on sta|
|00000280| 6e 2d 0d 20 20 20 20 20 | 64 61 72 64 20 20 69 6e |n-. |dard in|
|00000290| 70 75 74 20 20 61 6e 64 | 20 20 70 72 69 6e 74 73 |put and| prints|
|000002a0| 20 69 6e 66 65 72 72 65 | 64 20 74 79 70 65 73 20 | inferre|d types |
|000002b0| 61 6e 64 20 72 65 73 75 | 6c 74 20 76 61 6c 75 65 |and resu|lt value|
|000002c0| 73 20 6f 6e 0d 20 20 20 | 20 20 73 74 61 6e 64 61 |s on. | standa|
|000002d0| 72 64 20 6f 75 74 70 75 | 74 2e 20 20 45 6e 64 2d |rd outpu|t. End-|
|000002e0| 6f 66 2d 66 69 6c 65 20 | 6f 6e 20 73 74 61 6e 64 |of-file |on stand|
|000002f0| 61 72 64 20 20 69 6e 70 | 75 74 20 20 74 65 72 6d |ard inp|ut term|
|00000300| 69 6e 61 74 65 73 0d 20 | 20 20 20 20 43 61 6d 6c |inates. | Caml|
|00000310| 2e 0d 0d 20 20 20 20 20 | 43 41 4d 4c 20 4c 69 67 |... |CAML Lig|
|00000320| 68 74 20 63 61 6e 20 61 | 6c 73 6f 20 62 65 20 75 |ht can a|lso be u|
|00000330| 73 65 64 20 69 6e 20 62 | 61 74 63 68 20 6d 6f 64 |sed in b|atch mod|
|00000340| 65 2c 20 6d 75 63 68 20 | 6c 69 6b 65 20 20 74 68 |e, much |like th|
|00000350| 65 20 20 43 0d 20 20 20 | 20 20 63 6f 6d 70 69 6c |e C. | compil|
|00000360| 65 72 20 20 63 63 28 31 | 29 2e 20 20 20 54 68 69 |er cc(1|). Thi|
|00000370| 73 20 20 63 6f 72 72 65 | 73 70 6f 6e 64 73 20 20 |s corre|sponds |
|00000380| 74 6f 20 74 68 65 20 60 | 43 61 6d 6c 63 27 20 63 |to the `|Camlc' c|
|00000390| 6f 6d 6d 61 6e 64 0d 20 | 20 20 20 20 28 73 65 63 |ommand. | (sec|
|000003a0| 6f 6e 64 20 66 6f 72 6d | 20 61 62 6f 76 65 29 2e |ond form| above).|
|000003b0| 20 49 6e 20 74 68 69 73 | 20 6d 6f 64 65 2c 20 69 | In this| mode, i|
|000003c0| 74 20 61 63 63 65 70 74 | 73 20 73 65 76 65 72 61 |t accept|s severa|
|000003d0| 6c 20 20 74 79 70 65 73 | 0d 20 20 20 20 20 6f 66 |l types|. of|
|000003e0| 20 20 61 72 67 75 6d 65 | 6e 74 73 3a 20 20 73 6f | argume|nts: so|
|000003f0| 75 72 63 65 20 70 72 6f | 67 72 61 6d 73 2c 20 6d |urce pro|grams, m|
|00000400| 6f 64 75 6c 65 20 69 6e | 74 65 72 66 61 63 65 73 |odule in|terfaces|
|00000410| 2c 20 63 6f 6d 70 69 6c | 65 64 0d 20 20 20 20 20 |, compil|ed. |
|00000420| 6f 62 6a 65 63 74 20 70 | 72 6f 67 72 61 6d 73 2e |object p|rograms.|
|00000430| 0d 0d 20 20 20 20 20 41 | 72 67 75 6d 65 6e 74 73 |.. A|rguments|
|00000440| 20 65 6e 64 69 6e 67 20 | 69 6e 20 60 2e 6d 6c 69 | ending |in `.mli|
|00000450| 27 20 61 72 65 20 74 61 | 6b 65 6e 20 74 6f 20 62 |' are ta|ken to b|
|00000460| 65 20 20 74 68 65 20 20 | 73 6f 75 72 63 65 73 20 |e the |sources |
|00000470| 20 6f 66 0d 20 20 20 20 | 20 6d 6f 64 75 6c 65 20 | of. | module |
|00000480| 69 6e 74 65 72 66 61 63 | 65 73 2c 20 64 65 63 6c |interfac|es, decl|
|00000490| 61 72 69 6e 67 20 70 75 | 62 6c 69 63 20 67 6c 6f |aring pu|blic glo|
|000004a0| 62 61 6c 20 69 64 65 6e | 74 69 66 69 65 72 73 2c |bal iden|tifiers,|
|000004b0| 20 63 6f 6e 2d 0d 20 20 | 20 20 20 63 72 65 74 65 | con-. | crete|
|000004c0| 20 74 79 70 65 73 2c 2e | 2e 2e 20 20 46 72 6f 6d | types,.|.. From|
|000004d0| 20 74 68 65 20 66 69 6c | 65 20 20 78 78 78 2e 6d | the fil|e xxx.m|
|000004e0| 6c 69 2c 20 20 43 61 6d | 6c 63 20 20 70 72 6f 64 |li, Cam|lc prod|
|000004f0| 75 63 65 73 20 20 61 0d | 20 20 20 20 20 63 6f 6d |uces a.| com|
|00000500| 70 69 6c 65 64 20 69 6e | 74 65 72 66 61 63 65 2c |piled in|terface,|
|00000510| 20 69 6e 20 74 68 65 20 | 66 69 6c 65 20 78 78 78 | in the |file xxx|
|00000520| 2e 7a 69 2e 0d 0d 20 20 | 20 20 20 41 72 67 75 6d |.zi... | Argum|
|00000530| 65 6e 74 73 20 65 6e 64 | 69 6e 67 20 69 6e 20 60 |ents end|ing in `|
|00000540| 2e 6d 6c 27 20 61 72 65 | 20 74 61 6b 65 6e 20 74 |.ml' are| taken t|
|00000550| 6f 20 20 62 65 20 20 74 | 68 65 20 20 73 6f 75 72 |o be t|he sour|
|00000560| 63 65 73 20 20 6f 66 0d | 20 20 20 20 20 6d 6f 64 |ces of.| mod|
|00000570| 75 6c 65 20 20 69 6d 70 | 6c 65 6d 65 6e 74 61 74 |ule imp|lementat|
|00000580| 69 6f 6e 73 2c 20 20 64 | 65 66 69 6e 69 6e 67 20 |ions, d|efining |
|00000590| 20 67 6c 6f 62 61 6c 20 | 69 64 65 6e 74 69 66 69 | global |identifi|
|000005a0| 65 72 73 2c 20 63 6f 6e | 2d 0d 20 20 20 20 20 63 |ers, con|-. c|
|000005b0| 72 65 74 65 20 74 79 70 | 65 73 2c 20 61 6e 64 20 |rete typ|es, and |
|000005c0| 67 69 76 69 6e 67 20 65 | 78 70 72 65 73 73 69 6f |giving e|xpressio|
|000005d0| 6e 73 20 74 6f 20 20 62 | 65 20 20 65 76 61 6c 75 |ns to b|e evalu|
|000005e0| 61 74 65 64 2e 20 20 46 | 72 6f 6d 0d 20 20 20 20 |ated. F|rom. |
|000005f0| 20 74 68 65 20 20 66 69 | 6c 65 20 20 78 78 78 2e | the fi|le xxx.|
|00000600| 6d 6c 2c 20 43 61 6d 6c | 63 20 70 72 6f 64 75 63 |ml, Caml|c produc|
|00000610| 65 73 20 61 20 63 6f 6d | 70 69 6c 65 64 20 6f 62 |es a com|piled ob|
|00000620| 6a 65 63 74 20 63 6f 64 | 65 2c 20 69 6e 0d 20 20 |ject cod|e, in. |
|00000630| 20 20 20 74 68 65 20 66 | 69 6c 65 20 78 78 78 2e | the f|ile xxx.|
|00000640| 7a 6f 2c 20 61 6e 64 20 | 70 6f 73 73 69 62 6c 79 |zo, and |possibly|
|00000650| 20 61 20 63 6f 6d 70 69 | 6c 65 64 20 20 69 6e 74 | a compi|led int|
|00000660| 65 72 66 61 63 65 20 20 | 78 78 78 2e 7a 69 2e 0d |erface |xxx.zi..|
|00000670| 20 20 20 20 20 54 68 65 | 20 20 63 6f 6d 70 69 6c | The| compil|
|00000680| 65 64 20 20 69 6e 74 65 | 72 66 61 63 65 20 69 73 |ed inte|rface is|
|00000690| 20 6e 6f 74 20 70 72 6f | 64 75 63 65 64 20 69 66 | not pro|duced if|
|000006a0| 20 74 68 65 20 69 6e 74 | 65 72 66 61 63 65 20 6f | the int|erface o|
|000006b0| 66 0d 20 20 20 20 20 74 | 68 65 20 6d 6f 64 75 6c |f. t|he modul|
|000006c0| 65 20 69 73 20 65 78 70 | 6c 69 63 69 74 6c 79 20 |e is exp|licitly |
|000006d0| 67 69 76 65 6e 2c 20 74 | 68 61 74 20 20 69 73 2c |given, t|hat is,|
|000006e0| 20 20 69 66 20 20 66 69 | 6c 65 20 20 78 78 78 2e | if fi|le xxx.|
|000006f0| 6d 6c 69 0d 20 20 20 20 | 20 65 78 69 73 74 73 3b |mli. | exists;|
|00000700| 20 20 74 68 65 6e 2c 20 | 20 74 68 65 20 20 6d 6f | then, | the mo|
|00000710| 64 75 6c 65 20 69 6d 70 | 6c 65 6d 65 6e 74 61 74 |dule imp|lementat|
|00000720| 69 6f 6e 20 78 78 78 2e | 6d 6c 20 69 73 20 63 68 |ion xxx.|ml is ch|
|00000730| 65 63 6b 65 64 0d 20 20 | 20 20 20 61 67 61 69 6e |ecked. | again|
|00000740| 73 74 20 74 68 65 20 63 | 6f 6d 70 69 6c 65 64 20 |st the c|ompiled |
|00000750| 69 6e 74 65 72 66 61 63 | 65 20 78 78 78 2e 7a 69 |interfac|e xxx.zi|
|00000760| 2c 20 77 68 69 63 68 20 | 69 73 20 20 61 73 73 75 |, which |is assu|
|00000770| 6d 65 64 20 20 74 6f 0d | 20 20 20 20 20 65 78 69 |med to.| exi|
|00000780| 73 74 2e 20 20 20 48 6f | 77 65 76 65 72 2c 20 20 |st. Ho|wever, |
|00000790| 69 66 20 6e 6f 20 73 6f | 75 72 63 65 20 69 6e 74 |if no so|urce int|
|000007a0| 65 72 66 61 63 65 20 65 | 78 69 73 74 73 2c 20 74 |erface e|xists, t|
|000007b0| 68 65 6e 20 43 61 6d 6c | 63 0d 20 20 20 20 20 70 |hen Caml|c. p|
|000007c0| 72 6f 64 75 63 65 73 20 | 61 20 63 6f 6d 70 69 6c |roduces |a compil|
|000007d0| 65 64 20 69 6e 74 65 72 | 66 61 63 65 20 78 78 78 |ed inter|face xxx|
|000007e0| 2e 7a 69 2c 20 20 65 78 | 70 6f 72 74 69 6e 67 20 |.zi, ex|porting |
|000007f0| 20 65 76 65 72 79 74 68 | 69 6e 67 0d 20 20 20 20 | everyth|ing. |
|00000800| 20 74 68 61 74 20 69 73 | 20 64 65 66 69 6e 65 64 | that is| defined|
|00000810| 20 69 6e 20 74 68 65 20 | 69 6d 70 6c 65 6d 65 6e | in the |implemen|
|00000820| 74 61 74 69 6f 6e 20 78 | 78 78 2e 6d 6c 2e 0d 0d |tation x|xx.ml...|
|00000830| 20 20 20 20 20 41 72 67 | 75 6d 65 6e 74 73 20 65 | Arg|uments e|
|00000840| 6e 64 69 6e 67 20 69 6e | 20 60 2e 7a 6f 27 20 61 |nding in| `.zo' a|
|00000850| 72 65 20 74 61 6b 65 6e | 20 74 6f 20 20 62 65 20 |re taken| to be |
|00000860| 20 63 6f 6d 70 69 6c 65 | 64 20 20 6f 62 6a 65 63 | compile|d objec|
|00000870| 74 0d 20 20 20 20 20 63 | 6f 64 65 2e 20 54 68 65 |t. c|ode. The|
|00000880| 73 65 20 66 69 6c 65 73 | 20 61 72 65 20 6c 69 6e |se files| are lin|
|00000890| 6b 65 64 20 74 6f 67 65 | 74 68 65 72 2c 20 61 6c |ked toge|ther, al|
|000008a0| 6f 6e 67 20 77 69 74 68 | 20 74 68 65 20 6f 62 6a |ong with| the obj|
|000008b0| 65 63 74 0d 20 20 20 20 | 20 63 6f 64 65 20 66 69 |ect. | code fi|
|000008c0| 6c 65 73 20 6f 62 74 61 | 69 6e 65 64 20 62 79 20 |les obta|ined by |
|000008d0| 63 6f 6d 70 69 6c 69 6e | 67 20 60 2e 6d 6c 27 20 |compilin|g `.ml' |
|000008e0| 61 72 67 75 6d 65 6e 74 | 73 20 20 28 69 66 20 20 |argument|s (if |
|000008f0| 61 6e 79 29 2c 0d 20 20 | 20 20 20 61 6e 64 20 70 |any),. | and p|
|00000900| 61 72 74 73 20 6f 66 20 | 74 68 65 20 43 41 4d 4c |arts of |the CAML|
|00000910| 20 4c 69 67 68 74 20 6c | 69 62 72 61 72 79 2c 20 | Light l|ibrary, |
|00000920| 74 6f 20 70 72 6f 64 75 | 63 65 20 61 20 73 74 61 |to produ|ce a sta|
|00000930| 6e 64 61 6c 6f 6e 65 0d | 20 20 20 20 20 65 78 65 |ndalone.| exe|
|00000940| 63 75 74 61 62 6c 65 20 | 70 72 6f 67 72 61 6d 2e |cutable |program.|
|00000950| 20 54 68 65 20 20 6f 72 | 64 65 72 20 20 69 6e 20 | The or|der in |
|00000960| 20 77 68 69 63 68 20 20 | 60 2e 7a 6f 27 20 20 61 | which |`.zo' a|
|00000970| 6e 64 20 20 60 2e 6d 6c | 27 0d 20 20 20 20 20 61 |nd `.ml|'. a|
|00000980| 72 67 75 6d 65 6e 74 73 | 20 20 61 72 65 20 20 70 |rguments| are p|
|00000990| 72 65 73 65 6e 74 65 64 | 20 20 6f 6e 20 20 74 68 |resented| on th|
|000009a0| 65 20 63 6f 6d 6d 61 6e | 64 20 6c 69 6e 65 20 69 |e comman|d line i|
|000009b0| 73 20 72 65 6c 65 76 61 | 6e 74 2c 0d 20 20 20 20 |s releva|nt,. |
|000009c0| 20 73 69 6e 63 65 20 67 | 6c 6f 62 61 6c 20 69 64 | since g|lobal id|
|000009d0| 65 6e 74 69 66 69 65 72 | 73 20 61 72 65 20 69 6e |entifier|s are in|
|000009e0| 69 74 69 61 6c 69 7a 65 | 64 20 69 6e 20 20 74 68 |itialize|d in th|
|000009f0| 61 74 20 20 6f 72 64 65 | 72 20 20 61 74 0d 20 20 |at orde|r at. |
|00000a00| 20 20 20 72 75 6e 2d 74 | 69 6d 65 2c 20 20 61 6e | run-t|ime, an|
|00000a10| 64 20 69 74 20 69 73 20 | 61 20 6c 69 6e 6b 2d 74 |d it is |a link-t|
|00000a20| 69 6d 65 20 65 72 72 6f | 72 20 74 6f 20 75 73 65 |ime erro|r to use|
|00000a30| 20 61 20 67 6c 6f 62 61 | 6c 20 69 64 65 6e 2d 0d | a globa|l iden-.|
|00000a40| 20 20 20 20 20 74 69 66 | 69 65 72 20 62 65 66 6f | tif|ier befo|
|00000a50| 72 65 20 68 61 76 69 6e | 67 20 69 6e 69 74 69 61 |re havin|g initia|
|00000a60| 6c 69 7a 65 64 20 69 74 | 2e 0d 0d 20 20 20 20 20 |lized it|... |
|00000a70| 54 68 65 20 6f 75 74 70 | 75 74 20 20 6f 66 20 20 |The outp|ut of |
|00000a80| 74 68 65 20 20 6c 69 6e | 6b 69 6e 67 20 20 70 68 |the lin|king ph|
|00000a90| 61 73 65 20 20 69 73 20 | 20 61 20 20 66 69 6c 65 |ase is | a file|
|00000aa0| 20 20 63 6f 6e 74 61 69 | 6e 69 6e 67 0d 20 20 20 | contai|ning. |
|00000ab0| 20 20 62 79 74 65 63 6f | 64 65 20 20 65 78 65 63 | byteco|de exec|
|00000ac0| 75 74 61 62 6c 65 20 62 | 79 20 74 68 65 20 43 41 |utable b|y the CA|
|00000ad0| 4d 4c 20 4c 69 67 68 74 | 20 62 79 74 65 63 6f 64 |ML Light| bytecod|
|00000ae0| 65 20 69 6e 74 65 72 70 | 72 65 74 65 72 2e 0d 20 |e interp|reter.. |
|00000af0| 20 20 20 20 4f 6e 20 6d | 6f 73 74 20 73 79 73 74 | On m|ost syst|
|00000b00| 65 6d 73 2c 20 74 68 65 | 20 62 79 74 65 63 6f 64 |ems, the| bytecod|
|00000b10| 65 20 66 69 6c 65 20 63 | 61 6e 20 62 65 20 72 75 |e file c|an be ru|
|00000b20| 6e 20 20 64 69 72 65 63 | 74 6c 79 3a 20 20 69 74 |n direc|tly: it|
|00000b30| 0d 20 20 20 20 20 68 61 | 73 20 20 74 68 65 20 20 |. ha|s the |
|00000b40| 65 78 65 63 75 74 61 62 | 6c 65 20 20 62 69 74 20 |executab|le bit |
|00000b50| 20 73 65 74 2c 20 61 6e | 64 20 69 74 20 6d 61 6e | set, an|d it man|
|00000b60| 61 67 65 73 20 74 6f 20 | 6c 61 75 6e 63 68 20 74 |ages to |launch t|
|00000b70| 68 65 0d 20 20 20 20 20 | 62 79 74 65 63 6f 64 65 |he. |bytecode|
|00000b80| 20 69 6e 74 65 72 70 72 | 65 74 65 72 20 62 79 20 | interpr|eter by |
|00000b90| 69 74 73 65 6c 66 2e 20 | 49 66 20 74 68 69 73 20 |itself. |If this |
|00000ba0| 66 61 69 6c 73 2c 20 74 | 68 65 20 20 62 79 74 65 |fails, t|he byte|
|00000bb0| 63 6f 64 65 0d 20 20 20 | 20 20 66 69 6c 65 20 20 |code. | file |
|00000bc0| 6d 75 73 74 20 62 65 20 | 67 69 76 65 6e 20 61 73 |must be |given as|
|00000bd0| 20 66 69 72 73 74 20 61 | 72 67 75 6d 65 6e 74 20 | first a|rgument |
|00000be0| 74 6f 20 74 68 65 20 62 | 79 74 65 63 6f 64 65 20 |to the b|ytecode |
|00000bf0| 69 6e 74 65 72 2d 0d 20 | 20 20 20 20 70 72 65 74 |inter-. | pret|
|00000c00| 65 72 20 28 43 61 6d 6c | 52 75 6e 2c 20 77 69 74 |er (Caml|Run, wit|
|00000c10| 68 20 74 68 65 20 64 65 | 66 61 75 6c 74 20 69 6e |h the de|fault in|
|00000c20| 73 74 61 6c 6c 61 74 69 | 6f 6e 29 2e 0d 0d 0d 4f |stallati|on)....O|
|00000c30| 50 54 49 4f 4e 53 0d 20 | 20 20 20 20 54 68 65 20 |PTIONS. | The |
|00000c40| 66 6f 6c 6c 6f 77 69 6e | 67 20 6f 70 74 69 6f 6e |followin|g option|
|00000c50| 73 20 61 72 65 20 69 6e | 74 65 72 70 72 65 74 65 |s are in|terprete|
|00000c60| 64 20 62 79 20 43 61 6d | 6c 20 61 6e 64 20 43 61 |d by Cam|l and Ca|
|00000c70| 6d 6c 63 2e 0d 0d 0d 20 | 20 20 20 20 2d 63 20 20 |mlc.... | -c |
|00000c80| 20 43 6f 6d 70 69 6c 65 | 20 6f 6e 6c 79 2e 20 53 | Compile| only. S|
|00000c90| 75 70 70 72 65 73 73 65 | 73 20 74 68 65 20 6c 69 |uppresse|s the li|
|00000ca0| 6e 6b 69 6e 67 20 70 68 | 61 73 65 20 6f 66 20 74 |nking ph|ase of t|
|00000cb0| 68 65 20 20 63 6f 6d 2d | 0d 20 20 20 20 20 20 20 |he com-|. |
|00000cc0| 20 20 20 70 69 6c 61 74 | 69 6f 6e 2e 0d 0d 20 20 | pilat|ion... |
|00000cd0| 20 20 20 2d 6f 20 65 78 | 65 63 2d 66 69 6c 65 0d | -o ex|ec-file.|
|00000ce0| 20 20 20 20 20 20 20 20 | 20 20 53 70 65 63 69 66 | | Specif|
|00000cf0| 69 65 73 20 74 68 65 20 | 6e 61 6d 65 20 6f 66 20 |ies the |name of |
|00000d00| 74 68 65 20 6f 75 74 70 | 75 74 20 65 78 65 63 75 |the outp|ut execu|
|00000d10| 74 61 62 6c 65 20 20 66 | 69 6c 65 2e 20 20 54 68 |table f|ile. Th|
|00000d20| 65 0d 20 20 20 20 20 20 | 20 20 20 20 64 65 66 61 |e. | defa|
|00000d30| 75 6c 74 20 69 73 20 60 | 61 2e 6f 75 74 27 2e 0d |ult is `|a.out'..|
|00000d40| 0d 20 20 20 20 20 2d 49 | 20 6c 69 62 2d 64 69 72 |. -I| lib-dir|
|00000d50| 0d 20 20 20 20 20 20 20 | 20 20 20 41 64 64 73 20 |. | Adds |
|00000d60| 6c 69 62 2d 64 69 72 20 | 74 6f 20 74 68 65 20 70 |lib-dir |to the p|
|00000d70| 61 74 68 20 6f 66 20 20 | 64 69 72 65 63 74 6f 72 |ath of |director|
|00000d80| 69 65 73 20 20 73 65 61 | 72 63 68 65 64 20 20 66 |ies sea|rched f|
|00000d90| 6f 72 0d 20 20 20 20 20 | 20 20 20 20 20 63 6f 6d |or. | com|
|00000da0| 70 69 6c 65 64 20 20 69 | 6e 74 65 72 66 61 63 65 |piled i|nterface|
|00000db0| 20 20 66 69 6c 65 73 20 | 20 60 2e 7a 69 27 20 20 | files | `.zi' |
|00000dc0| 61 6e 64 20 20 63 6f 6d | 70 69 6c 65 64 20 6f 62 |and com|piled ob|
|00000dd0| 6a 65 63 74 0d 20 20 20 | 20 20 20 20 20 20 20 66 |ject. | f|
|00000de0| 69 6c 65 73 20 60 2e 7a | 6f 27 2e 20 54 68 65 20 |iles `.z|o'. The |
|00000df0| 64 65 66 61 75 6c 74 20 | 69 73 20 74 6f 20 73 65 |default |is to se|
|00000e00| 61 72 63 68 20 69 6e 20 | 74 68 65 20 43 41 4d 4c |arch in |the CAML|
|00000e10| 20 4c 69 67 68 74 0d 20 | 20 20 20 20 20 20 20 20 | Light. | |
|00000e20| 20 6c 69 62 72 61 72 79 | 20 66 69 72 73 74 20 28 | library| first (|
|00000e30| 75 73 75 61 6c 6c 79 20 | 22 4d 61 63 69 6e 74 6f |usually |"Macinto|
|00000e40| 73 68 20 48 44 3a 43 61 | 6d 6c 20 4c 69 67 68 74 |sh HD:Ca|ml Light|
|00000e50| 3a 4c 69 62 3a 22 29 2c | 0d 20 20 20 20 20 20 20 |:Lib:"),|. |
|00000e60| 20 20 20 74 68 65 6e 20 | 69 6e 20 74 68 65 20 63 | then |in the c|
|00000e70| 75 72 72 65 6e 74 20 64 | 69 72 65 63 74 6f 72 79 |urrent d|irectory|
|00000e80| 2e 20 41 20 64 69 72 65 | 63 74 6f 72 79 20 61 64 |. A dire|ctory ad|
|00000e90| 64 65 64 20 62 79 20 20 | 2d 49 0d 20 20 20 20 20 |ded by |-I. |
|00000ea0| 20 20 20 20 20 69 73 20 | 20 73 65 61 72 63 68 65 | is | searche|
|00000eb0| 64 20 20 66 69 72 73 74 | 2e 20 20 54 68 69 73 20 |d first|. This |
|00000ec0| 20 6f 70 74 69 6f 6e 20 | 74 61 6b 65 73 20 65 66 | option |takes ef|
|00000ed0| 66 65 63 74 20 66 6f 72 | 20 74 68 65 0d 20 20 20 |fect for| the. |
|00000ee0| 20 20 20 20 20 20 20 63 | 6f 6d 70 69 6c 61 74 69 | c|ompilati|
|00000ef0| 6f 6e 20 6f 66 20 73 75 | 62 73 65 71 75 65 6e 74 |on of su|bsequent|
|00000f00| 20 60 2e 6d 6c 27 20 61 | 6e 64 20 20 60 2e 6d 6c | `.ml' a|nd `.ml|
|00000f10| 69 27 20 20 66 69 6c 65 | 73 2c 20 20 61 73 0d 20 |i' file|s, as. |
|00000f20| 20 20 20 20 20 20 20 20 | 20 77 65 6c 6c 20 61 73 | | well as|
|00000f30| 20 66 6f 72 20 74 68 65 | 20 66 69 6e 61 6c 20 6c | for the| final l|
|00000f40| 69 6e 6b 69 6e 67 2e 0d | 0d 20 20 20 20 20 2d 4f |inking..|. -O|
|00000f50| 20 6d 6f 64 75 6c 65 2d | 73 65 74 0d 20 20 20 20 | module-|set. |
|00000f60| 20 20 20 20 20 20 53 70 | 65 63 69 66 69 65 73 20 | Sp|ecifies |
|00000f70| 77 68 69 63 68 20 73 65 | 74 20 6f 66 20 73 74 61 |which se|t of sta|
|00000f80| 6e 64 61 72 64 20 6c 69 | 62 72 61 72 79 20 6d 6f |ndard li|brary mo|
|00000f90| 64 75 6c 65 73 20 61 72 | 65 20 20 74 6f 0d 20 20 |dules ar|e to. |
|00000fa0| 20 20 20 20 20 20 20 20 | 62 65 20 20 69 6d 70 6c | |be impl|
|00000fb0| 69 63 69 74 6c 79 20 20 | 22 6f 70 65 6e 65 64 22 |icitly |"opened"|
|00000fc0| 20 61 74 20 74 68 65 20 | 62 65 67 69 6e 6e 69 6e | at the |beginnin|
|00000fd0| 67 20 6f 66 20 61 20 63 | 6f 6d 70 69 6c 61 2d 0d |g of a c|ompila-.|
|00000fe0| 20 20 20 20 20 20 20 20 | 20 20 74 69 6f 6e 2c 20 | | tion, |
|00000ff0| 61 6e 64 20 6c 69 6e 6b | 65 64 20 77 69 74 68 20 |and link|ed with |
|00001000| 20 74 68 65 20 20 75 73 | 65 72 27 73 20 20 6f 62 | the us|er's ob|
|00001010| 6a 65 63 74 20 20 63 6f | 64 65 2e 20 20 28 53 65 |ject co|de. (Se|
|00001020| 65 0d 20 20 20 20 20 20 | 20 20 20 20 62 65 6c 6f |e. | belo|
|00001030| 77 20 20 74 68 65 20 20 | 73 65 63 74 69 6f 6e 20 |w the |section |
|00001040| 20 6f 6e 20 20 6d 6f 64 | 75 6c 65 73 20 20 66 6f | on mod|ules fo|
|00001050| 72 20 61 6e 20 65 78 70 | 6c 61 6e 61 74 69 6f 6e |r an exp|lanation|
|00001060| 20 6f 66 0d 20 20 20 20 | 20 20 20 20 20 20 22 6f | of. | "o|
|00001070| 70 65 6e 65 64 22 20 20 | 6d 6f 64 75 6c 65 73 29 |pened" |modules)|
|00001080| 2e 20 20 54 68 65 72 65 | 20 20 61 72 65 20 20 20 |. There| are |
|00001090| 74 68 72 65 65 20 20 20 | 6d 6f 64 75 6c 65 20 20 |three |module |
|000010a0| 20 73 65 74 73 0d 20 20 | 20 20 20 20 20 20 20 20 | sets. | |
|000010b0| 63 75 72 72 65 6e 74 6c | 79 20 61 76 61 69 6c 61 |currentl|y availa|
|000010c0| 62 6c 65 3a 20 22 63 61 | 75 74 69 6f 75 73 22 20 |ble: "ca|utious" |
|000010d0| 61 6e 64 20 22 66 61 73 | 74 22 2c 20 61 6e 64 20 |and "fas|t", and |
|000010e0| 22 6e 6f 6e 65 22 2e 0d | 20 20 20 20 20 20 20 20 |"none"..| |
|000010f0| 20 20 22 43 61 75 74 69 | 6f 75 73 22 20 61 6e 64 | "Cauti|ous" and|
|00001100| 20 22 66 61 73 74 22 20 | 62 6f 74 68 20 70 72 6f | "fast" |both pro|
|00001110| 76 69 64 65 20 20 74 68 | 65 20 20 73 61 6d 65 20 |vide th|e same |
|00001120| 20 73 74 61 6e 64 61 72 | 64 0d 20 20 20 20 20 20 | standar|d. |
|00001130| 20 20 20 20 6f 70 65 72 | 61 74 69 6f 6e 73 20 6f | oper|ations o|
|00001140| 6e 20 69 6e 74 65 67 65 | 72 73 2c 20 66 6c 6f 61 |n intege|rs, floa|
|00001150| 74 69 6e 67 2d 70 6f 69 | 6e 74 20 6e 75 6d 62 65 |ting-poi|nt numbe|
|00001160| 72 73 2c 20 63 68 61 72 | 61 63 2d 0d 20 20 20 20 |rs, char|ac-. |
|00001170| 20 20 20 20 20 20 74 65 | 72 73 20 61 6e 64 20 63 | te|rs and c|
|00001180| 68 61 72 61 63 74 65 72 | 20 73 74 72 69 6e 67 73 |haracter| strings|
|00001190| 2c 20 70 6f 6c 79 6d 6f | 72 70 68 69 63 20 6c 69 |, polymo|rphic li|
|000011a0| 73 74 73 20 61 6e 64 20 | 20 76 65 63 2d 0d 20 20 |sts and | vec-. |
|000011b0| 20 20 20 20 20 20 20 20 | 74 6f 72 73 2c 20 20 2e | |tors, .|
|000011c0| 2e 2e 2c 20 20 61 73 20 | 20 77 65 6c 6c 20 20 61 |.., as | well a|
|000011d0| 73 20 62 61 73 69 63 20 | 69 6e 70 75 74 2f 6f 75 |s basic |input/ou|
|000011e0| 74 70 75 74 2c 20 65 78 | 63 65 70 74 69 6f 6e 0d |tput, ex|ception.|
|000011f0| 20 20 20 20 20 20 20 20 | 20 20 68 61 6e 64 6c 69 | | handli|
|00001200| 6e 67 2c 20 2e 2e 2e 20 | 4d 6f 64 75 6c 65 73 20 |ng, ... |Modules |
|00001210| 66 72 6f 6d 20 74 68 65 | 20 22 63 61 75 74 69 6f |from the| "cautio|
|00001220| 75 73 22 20 20 73 65 74 | 20 20 70 65 72 66 6f 72 |us" set| perfor|
|00001230| 6d 0d 20 20 20 20 20 20 | 20 20 20 20 72 61 6e 67 |m. | rang|
|00001240| 65 20 20 61 6e 64 20 20 | 62 6f 75 6e 64 20 20 63 |e and |bound c|
|00001250| 68 65 63 6b 69 6e 67 20 | 6f 6e 20 73 74 72 69 6e |hecking |on strin|
|00001260| 67 20 61 6e 64 20 76 65 | 63 74 6f 72 20 6f 70 65 |g and ve|ctor ope|
|00001270| 72 61 2d 0d 20 20 20 20 | 20 20 20 20 20 20 74 69 |ra-. | ti|
|00001280| 6f 6e 73 2c 20 61 6e 64 | 20 76 61 72 69 6f 75 73 |ons, and| various|
|00001290| 20 73 61 6e 69 74 79 20 | 63 68 65 63 6b 73 20 6f | sanity |checks o|
|000012a0| 6e 20 74 68 65 69 72 20 | 61 72 67 75 6d 65 6e 74 |n their |argument|
|000012b0| 73 20 20 61 73 0d 20 20 | 20 20 20 20 20 20 20 20 |s as. | |
|000012c0| 77 65 6c 6c 2c 20 20 77 | 68 69 6c 65 20 74 68 6f |well, w|hile tho|
|000012d0| 73 65 20 66 72 6f 6d 20 | 74 68 65 20 22 66 61 73 |se from |the "fas|
|000012e0| 74 22 20 73 65 74 20 64 | 6f 6e 27 74 20 63 68 65 |t" set d|on't che|
|000012f0| 63 6b 20 61 6e 79 2d 0d | 20 20 20 20 20 20 20 20 |ck any-.| |
|00001300| 20 20 74 68 69 6e 67 2e | 20 54 68 65 20 64 65 66 | thing.| The def|
|00001310| 61 75 6c 74 20 69 73 20 | 22 63 61 75 74 69 6f 75 |ault is |"cautiou|
|00001320| 73 22 2e 20 54 68 65 20 | 22 2d 4f 20 6e 6f 6e 65 |s". The |"-O none|
|00001330| 22 20 20 6f 70 74 69 6f | 6e 0d 20 20 20 20 20 20 |" optio|n. |
|00001340| 20 20 20 20 73 75 70 70 | 72 65 73 73 65 73 20 20 | supp|resses |
|00001350| 61 6c 6c 20 20 64 65 66 | 61 75 6c 74 20 20 6d 6f |all def|ault mo|
|00001360| 64 75 6c 65 20 20 6f 70 | 65 6e 69 6e 67 3b 20 20 |dule op|ening; |
|00001370| 63 6f 6d 70 69 6c 61 74 | 69 6f 6e 0d 20 20 20 20 |compilat|ion. |
|00001380| 20 20 20 20 20 20 73 74 | 61 72 74 73 20 69 6e 20 | st|arts in |
|00001390| 61 6e 20 28 61 6c 6d 6f | 73 74 29 20 65 6d 70 74 |an (almo|st) empt|
|000013a0| 79 20 65 6e 76 69 72 6f | 6e 6d 65 6e 74 2c 20 61 |y enviro|nment, a|
|000013b0| 6e 64 20 6e 6f 20 6c 69 | 62 72 61 72 79 0d 20 20 |nd no li|brary. |
|000013c0| 20 20 20 20 20 20 20 20 | 63 6f 64 65 20 20 69 73 | |code is|
|000013d0| 20 20 6c 69 6e 6b 65 64 | 2e 20 20 49 74 20 20 69 | linked|. It i|
|000013e0| 73 20 6e 6f 74 20 6f 66 | 20 67 65 6e 65 72 61 6c |s not of| general|
|000013f0| 20 75 73 65 2c 20 65 78 | 63 65 70 74 20 74 6f 0d | use, ex|cept to.|
|00001400| 20 20 20 20 20 20 20 20 | 20 20 63 6f 6d 70 69 6c | | compil|
|00001410| 65 20 74 68 65 20 73 74 | 61 6e 64 61 72 64 20 6c |e the st|andard l|
|00001420| 69 62 72 61 72 79 20 69 | 74 73 65 6c 66 2e 0d 0d |ibrary i|tself...|
|00001430| 0d 0d 4f 56 45 52 56 49 | 45 57 20 4f 46 20 54 48 |..OVERVI|EW OF TH|
|00001440| 45 20 4d 4f 44 55 4c 45 | 20 53 59 53 54 45 4d 0d |E MODULE| SYSTEM.|
|00001450| 20 20 20 20 20 43 41 4d | 4c 20 4c 69 67 68 74 20 | CAM|L Light |
|00001460| 75 73 65 73 20 61 20 4d | 6f 64 75 6c 61 2d 32 2d |uses a M|odula-2-|
|00001470| 6c 69 6b 65 20 6d 6f 64 | 75 6c 65 20 73 79 73 74 |like mod|ule syst|
|00001480| 65 6d 20 20 74 6f 20 20 | 67 75 61 72 61 6e 74 65 |em to |guarante|
|00001490| 65 0d 20 20 20 20 20 74 | 79 70 65 20 20 73 61 66 |e. t|ype saf|
|000014a0| 65 74 79 20 20 69 6e 20 | 20 74 68 65 20 70 72 65 |ety in | the pre|
|000014b0| 73 65 6e 63 65 20 6f 66 | 20 73 65 70 61 72 61 74 |sence of| separat|
|000014c0| 65 20 63 6f 6d 70 69 6c | 61 74 69 6f 6e 2e 20 45 |e compil|ation. E|
|000014d0| 61 63 68 0d 20 20 20 20 | 20 43 41 4d 4c 20 73 6f |ach. | CAML so|
|000014e0| 75 72 63 65 20 66 69 6c | 65 20 28 61 6e 20 22 69 |urce fil|e (an "i|
|000014f0| 6d 70 6c 65 6d 65 6e 74 | 61 74 69 6f 6e 22 2c 20 |mplement|ation", |
|00001500| 69 6e 20 74 68 65 20 66 | 6f 6c 6c 6f 77 69 6e 67 |in the f|ollowing|
|00001510| 29 20 20 69 73 0d 20 20 | 20 20 20 61 73 73 6f 63 |) is. | assoc|
|00001520| 69 61 74 65 64 20 61 6e | 20 69 6e 74 65 72 66 61 |iated an| interfa|
|00001530| 63 65 20 66 69 6c 65 2c | 20 64 65 73 63 72 69 62 |ce file,| describ|
|00001540| 69 6e 67 20 74 68 65 20 | 67 6c 6f 62 61 6c 20 69 |ing the |global i|
|00001550| 64 65 6e 74 69 66 2d 0d | 20 20 20 20 20 69 65 72 |dentif-.| ier|
|00001560| 73 20 61 6e 64 20 63 6f | 6e 63 72 65 74 65 20 74 |s and co|ncrete t|
|00001570| 79 70 65 73 20 69 74 20 | 70 75 62 6c 69 63 69 7a |ypes it |publiciz|
|00001580| 65 73 2e 20 20 20 48 65 | 72 65 20 20 69 73 20 20 |es. He|re is |
|00001590| 61 20 20 73 61 6d 70 6c | 65 0d 20 20 20 20 20 69 |a sampl|e. i|
|000015a0| 6e 74 65 72 66 61 63 65 | 20 73 6f 75 72 63 65 20 |nterface| source |
|000015b0| 66 69 6c 65 2c 20 73 74 | 61 63 6b 2e 6d 6c 69 3a |file, st|ack.mli:|
|000015c0| 0d 0d 20 20 20 20 20 20 | 20 20 20 74 79 70 65 20 |.. | type |
|000015d0| 27 61 20 6f 70 74 69 6f | 6e 61 6c 20 3d 20 4e 6f |'a optio|nal = No|
|000015e0| 6e 65 20 7c 20 53 6f 6d | 65 20 6f 66 20 27 61 3b |ne | Som|e of 'a;|
|000015f0| 3b 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 28 |;. | (|
|00001600| 2a 20 70 75 62 6c 69 63 | 20 74 79 70 65 20 2a 29 |* public| type *)|
|00001610| 0d 20 20 20 20 20 20 20 | 20 20 74 79 70 65 20 27 |. | type '|
|00001620| 61 20 73 74 61 63 6b 3b | 3b 0d 20 20 20 20 20 20 |a stack;|;. |
|00001630| 20 20 20 20 20 20 20 28 | 2a 20 61 62 73 74 72 61 | (|* abstra|
|00001640| 63 74 20 74 79 70 65 20 | 2a 29 0d 20 20 20 20 20 |ct type |*). |
|00001650| 20 20 20 20 65 78 63 65 | 70 74 69 6f 6e 20 53 74 | exce|ption St|
|00001660| 61 63 6b 5f 65 72 72 6f | 72 20 6f 66 20 73 74 72 |ack_erro|r of str|
|00001670| 69 6e 67 3b 3b 0d 20 20 | 20 20 20 20 20 20 20 76 |ing;;. | v|
|00001680| 61 6c 75 65 20 65 6d 70 | 74 79 20 3a 20 27 61 20 |alue emp|ty : 'a |
|00001690| 73 74 61 63 6b 0d 20 20 | 20 20 20 20 20 20 20 20 |stack. | |
|000016a0| 20 61 6e 64 20 70 75 73 | 68 20 3a 20 27 61 20 2d | and pus|h : 'a -|
|000016b0| 3e 20 27 61 20 73 74 61 | 63 6b 20 2d 3e 20 27 61 |> 'a sta|ck -> 'a|
|000016c0| 20 73 74 61 63 6b 0d 20 | 20 20 20 20 20 20 20 20 | stack. | |
|000016d0| 20 20 61 6e 64 20 70 6f | 70 20 20 3a 20 27 61 20 | and po|p : 'a |
|000016e0| 73 74 61 63 6b 20 2d 3e | 20 27 61 20 2a 20 27 61 |stack ->| 'a * 'a|
|000016f0| 20 73 74 61 63 6b 0d 20 | 20 20 20 20 20 20 20 20 | stack. | |
|00001700| 20 20 61 6e 64 20 74 6f | 70 20 20 3a 20 27 61 20 | and to|p : 'a |
|00001710| 73 74 61 63 6b 20 2d 3e | 20 27 61 20 6f 70 74 69 |stack ->| 'a opti|
|00001720| 6f 6e 61 6c 3b 3b 0d 0d | 20 20 20 20 20 48 65 72 |onal;;..| Her|
|00001730| 65 20 69 73 20 61 6e 20 | 69 6d 70 6c 65 6d 65 6e |e is an |implemen|
|00001740| 74 61 74 69 6f 6e 20 28 | 73 74 61 63 6b 2e 6d 6c |tation (|stack.ml|
|00001750| 29 20 74 68 61 74 20 6d | 65 65 74 73 20 20 74 68 |) that m|eets th|
|00001760| 65 20 20 69 6e 74 65 72 | 2d 0d 20 20 20 20 20 66 |e inter|-. f|
|00001770| 61 63 65 20 61 62 6f 76 | 65 3a 0d 0d 20 20 20 20 |ace abov|e:.. |
|00001780| 20 20 20 20 20 74 79 70 | 65 20 27 61 20 73 74 61 | typ|e 'a sta|
|00001790| 63 6b 20 3d 20 53 74 61 | 63 6b 20 6f 66 20 27 61 |ck = Sta|ck of 'a|
|000017a0| 20 6c 69 73 74 3b 3b 0d | 20 20 20 20 20 20 20 20 | list;;.| |
|000017b0| 20 6c 65 74 20 73 74 61 | 63 6b 5f 65 72 72 6f 72 | let sta|ck_error|
|000017c0| 20 73 20 3d 20 72 61 69 | 73 65 20 28 53 74 61 63 | s = rai|se (Stac|
|000017d0| 6b 5f 65 72 72 6f 72 20 | 73 29 3b 3b 0d 20 20 20 |k_error |s);;. |
|000017e0| 20 20 20 20 20 20 6c 65 | 74 20 65 6d 70 74 79 20 | le|t empty |
|000017f0| 3d 20 53 74 61 63 6b 20 | 5b 5d 3b 3b 0d 20 20 20 |= Stack |[];;. |
|00001800| 20 20 20 20 20 20 6c 65 | 74 20 70 75 73 68 20 78 | le|t push x|
|00001810| 20 28 53 74 61 63 6b 20 | 73 29 20 3d 20 53 74 61 | (Stack |s) = Sta|
|00001820| 63 6b 20 28 78 3a 3a 73 | 29 3b 3b 0d 20 20 20 20 |ck (x::s|);;. |
|00001830| 20 20 20 20 20 6c 65 74 | 20 70 6f 70 20 3d 20 66 | let| pop = f|
|00001840| 75 6e 63 74 69 6f 6e 0d | 20 20 20 20 20 20 20 20 |unction.| |
|00001850| 20 20 20 20 20 53 74 61 | 63 6b 20 5b 5d 20 2d 3e | Sta|ck [] ->|
|00001860| 20 72 61 69 73 65 20 28 | 53 74 61 63 6b 5f 65 72 | raise (|Stack_er|
|00001870| 72 6f 72 20 22 65 6d 70 | 74 79 22 29 0d 20 20 20 |ror "emp|ty"). |
|00001880| 20 20 20 20 20 20 20 20 | 7c 20 53 74 61 63 6b 20 | || Stack |
|00001890| 28 61 3a 3a 73 29 20 2d | 3e 20 28 61 2c 20 53 74 |(a::s) -|> (a, St|
|000018a0| 61 63 6b 20 73 29 3b 3b | 0d 20 20 20 20 20 20 20 |ack s);;|. |
|000018b0| 20 20 6c 65 74 20 74 6f | 70 20 3d 20 66 75 6e 63 | let to|p = func|
|000018c0| 74 69 6f 6e 0d 20 20 20 | 20 20 20 20 20 20 20 20 |tion. | |
|000018d0| 20 20 53 74 61 63 6b 20 | 5b 5d 20 2d 3e 20 4e 6f | Stack |[] -> No|
|000018e0| 6e 65 0d 20 20 20 20 20 | 20 20 20 20 20 20 7c 20 |ne. | | |
|000018f0| 53 74 61 63 6b 20 28 61 | 3a 3a 73 29 20 2d 3e 20 |Stack (a|::s) -> |
|00001900| 53 6f 6d 65 20 61 3b 3b | 0d 0d 20 20 20 20 20 54 |Some a;;|.. T|
|00001910| 68 65 20 67 6c 6f 62 61 | 6c 20 22 73 74 61 63 6b |he globa|l "stack|
|00001920| 5f 65 72 72 6f 72 22 2c | 20 61 6e 64 20 74 68 65 |_error",| and the|
|00001930| 20 63 6f 6e 73 74 72 75 | 63 74 6f 72 20 20 22 53 | constru|ctor "S|
|00001940| 74 61 63 6b 22 2c 20 20 | 61 72 65 0d 20 20 20 20 |tack", |are. |
|00001950| 20 6e 6f 74 20 20 65 78 | 70 6f 72 74 65 64 2c 20 | not ex|ported, |
|00001960| 20 68 65 6e 63 65 20 72 | 65 6d 61 69 6e 73 20 70 | hence r|emains p|
|00001970| 72 69 76 61 74 65 20 74 | 6f 20 74 68 65 20 69 6d |rivate t|o the im|
|00001980| 70 6c 65 6d 65 6e 74 61 | 74 69 6f 6e 2e 0d 20 20 |plementa|tion.. |
|00001990| 20 20 20 54 68 65 20 69 | 6d 70 6c 65 6d 65 6e 74 | The i|mplement|
|000019a0| 61 74 69 6f 6e 20 63 61 | 6e 20 66 72 65 65 6c 79 |ation ca|n freely|
|000019b0| 20 6d 61 6b 65 20 75 73 | 65 20 6f 66 20 67 6c 6f | make us|e of glo|
|000019c0| 62 61 6c 73 20 20 74 68 | 61 74 20 20 61 72 65 0d |bals th|at are.|
|000019d0| 20 20 20 20 20 64 65 66 | 69 6e 65 64 20 20 69 6e | def|ined in|
|000019e0| 20 20 74 68 65 20 20 69 | 6e 74 65 72 66 61 63 65 | the i|nterface|
|000019f0| 2c 20 20 65 2e 67 2e 20 | 74 68 65 20 63 6f 6e 73 |, e.g. |the cons|
|00001a00| 74 72 75 63 74 6f 72 73 | 20 4e 6f 6e 65 20 61 6e |tructors| None an|
|00001a10| 64 0d 20 20 20 20 20 53 | 6f 6d 65 20 2c 20 61 6e |d. S|ome , an|
|00001a20| 64 20 74 68 65 20 65 78 | 63 65 70 74 69 6f 6e 20 |d the ex|ception |
|00001a30| 53 74 61 63 6b 5f 65 72 | 72 6f 72 2e 20 48 6f 77 |Stack_er|ror. How|
|00001a40| 65 76 65 72 2c 20 67 6c | 6f 62 61 6c 73 20 20 74 |ever, gl|obals t|
|00001a50| 68 61 74 0d 20 20 20 20 | 20 61 72 65 20 6f 6e 6c |hat. | are onl|
|00001a60| 79 20 64 65 63 6c 61 72 | 65 64 2c 20 73 75 63 68 |y declar|ed, such|
|00001a70| 20 61 73 20 74 68 65 20 | 74 79 70 65 20 73 74 61 | as the |type sta|
|00001a80| 63 6b 2c 20 61 6e 64 20 | 74 68 65 20 70 75 73 68 |ck, and |the push|
|00001a90| 2c 20 70 6f 70 0d 20 20 | 20 20 20 61 6e 64 20 74 |, pop. | and t|
|00001aa0| 6f 70 20 66 75 6e 63 74 | 69 6f 6e 73 2c 20 6d 75 |op funct|ions, mu|
|00001ab0| 73 74 20 62 65 20 64 65 | 66 69 6e 65 64 20 20 62 |st be de|fined b|
|00001ac0| 79 20 20 74 68 65 20 20 | 69 6d 70 6c 65 6d 65 6e |y the |implemen|
|00001ad0| 74 61 74 69 6f 6e 2c 0d | 20 20 20 20 20 61 6e 64 |tation,.| and|
|00001ae0| 20 63 61 6e 6e 6f 74 20 | 62 65 20 72 65 66 65 72 | cannot |be refer|
|00001af0| 65 6e 63 65 64 20 62 65 | 66 6f 72 65 20 62 65 69 |enced be|fore bei|
|00001b00| 6e 67 20 64 65 66 69 6e | 65 64 2e 0d 0d 20 20 20 |ng defin|ed... |
|00001b10| 20 20 49 74 20 69 73 20 | 61 6c 73 6f 20 70 6f 73 | It is |also pos|
|00001b20| 73 69 62 6c 65 20 74 6f | 20 6c 65 74 20 74 68 65 |sible to| let the|
|00001b30| 20 43 41 4d 4c 20 4c 69 | 67 68 74 20 63 6f 6d 70 | CAML Li|ght comp|
|00001b40| 69 6c 65 72 20 20 67 65 | 6e 65 72 61 74 65 0d 20 |iler ge|nerate. |
|00001b50| 20 20 20 20 61 20 20 63 | 6f 6d 70 69 6c 65 64 20 | a c|ompiled |
|00001b60| 20 69 6e 74 65 72 66 61 | 63 65 20 20 28 73 74 61 | interfa|ce (sta|
|00001b70| 63 6b 2e 7a 69 29 20 20 | 66 72 6f 6d 20 74 68 65 |ck.zi) |from the|
|00001b80| 20 69 6d 70 6c 65 6d 65 | 6e 74 61 74 69 6f 6e 2e | impleme|ntation.|
|00001b90| 0d 20 20 20 20 20 54 68 | 65 6e 2c 20 69 74 20 61 |. Th|en, it a|
|00001ba0| 73 73 75 6d 65 73 20 61 | 6c 6c 20 67 6c 6f 62 61 |ssumes a|ll globa|
|00001bb0| 6c 73 20 61 72 65 20 20 | 74 6f 20 20 62 65 20 20 |ls are |to be |
|00001bc0| 65 78 70 6f 72 74 65 64 | 2e 20 20 49 6e 20 20 74 |exported|. In t|
|00001bd0| 68 65 0d 20 20 20 20 20 | 65 78 61 6d 70 6c 65 20 |he. |example |
|00001be0| 61 62 6f 76 65 2c 20 77 | 65 20 77 6f 75 6c 64 20 |above, w|e would |
|00001bf0| 67 65 74 20 61 20 63 6f | 6d 70 69 6c 65 64 20 69 |get a co|mpiled i|
|00001c00| 6e 74 65 72 66 61 63 65 | 20 63 6f 72 72 65 73 70 |nterface| corresp|
|00001c10| 6f 6e 64 2d 0d 20 20 20 | 20 20 69 6e 67 20 74 6f |ond-. | ing to|
|00001c20| 3a 0d 20 20 20 20 20 20 | 20 20 20 74 79 70 65 20 |:. | type |
|00001c30| 27 61 20 6f 70 74 69 6f | 6e 61 6c 20 3d 20 4e 6f |'a optio|nal = No|
|00001c40| 6e 65 20 7c 20 53 6f 6d | 65 20 6f 66 20 27 61 0d |ne | Som|e of 'a.|
|00001c50| 20 20 20 20 20 20 20 20 | 20 20 61 6e 64 20 27 61 | | and 'a|
|00001c60| 20 73 74 61 63 6b 20 3d | 20 53 74 61 63 6b 20 6f | stack =| Stack o|
|00001c70| 66 20 27 61 20 6c 69 73 | 74 3b 3b 0d 20 20 20 20 |f 'a lis|t;;. |
|00001c80| 20 20 20 20 20 65 78 63 | 65 70 74 69 6f 6e 20 53 | exc|eption S|
|00001c90| 74 61 63 6b 5f 65 72 72 | 6f 72 20 6f 66 20 73 74 |tack_err|or of st|
|00001ca0| 72 69 6e 67 3b 3b 0d 20 | 20 20 20 20 20 20 20 20 |ring;;. | |
|00001cb0| 76 61 6c 75 65 20 73 74 | 61 63 6b 5f 65 72 72 6f |value st|ack_erro|
|00001cc0| 72 20 3a 20 73 74 72 69 | 6e 67 20 2d 3e 20 27 61 |r : stri|ng -> 'a|
|00001cd0| 0d 20 20 20 20 20 20 20 | 20 20 20 20 61 6e 64 20 |. | and |
|00001ce0| 65 6d 70 74 79 20 3a 20 | 27 61 20 73 74 61 63 6b |empty : |'a stack|
|00001cf0| 0d 20 20 20 20 20 20 20 | 20 20 20 20 61 6e 64 20 |. | and |
|00001d00| 70 75 73 68 20 3a 20 27 | 61 20 2d 3e 20 27 61 20 |push : '|a -> 'a |
|00001d10| 73 74 61 63 6b 20 2d 3e | 20 27 61 20 73 74 61 63 |stack ->| 'a stac|
|00001d20| 6b 0d 20 20 20 20 20 20 | 20 20 20 20 20 61 6e 64 |k. | and|
|00001d30| 20 70 6f 70 20 20 3a 20 | 27 61 20 73 74 61 63 6b | pop : |'a stack|
|00001d40| 20 2d 3e 20 27 61 20 2a | 20 27 61 20 73 74 61 63 | -> 'a *| 'a stac|
|00001d50| 6b 0d 20 20 20 20 20 20 | 20 20 20 20 20 61 6e 64 |k. | and|
|00001d60| 20 74 6f 70 20 20 3a 20 | 27 61 20 73 74 61 63 6b | top : |'a stack|
|00001d70| 20 2d 3e 20 27 61 20 6f | 70 74 69 6f 6e 61 6c 3b | -> 'a o|ptional;|
|00001d80| 3b 0d 0d 20 20 20 20 20 | 54 77 6f 20 6d 65 63 68 |;.. |Two mech|
|00001d90| 61 6e 69 73 6d 73 20 61 | 72 65 20 70 72 6f 76 69 |anisms a|re provi|
|00001da0| 64 65 64 20 74 6f 20 72 | 65 66 65 72 20 74 6f 20 |ded to r|efer to |
|00001db0| 61 20 67 6c 6f 62 61 6c | 20 64 65 66 69 6e 65 64 |a global| defined|
|00001dc0| 20 20 69 6e 0d 20 20 20 | 20 20 61 6e 6f 74 68 65 | in. | anothe|
|00001dd0| 72 20 20 6d 6f 64 75 6c | 65 2e 20 20 54 68 65 20 |r modul|e. The |
|00001de0| 66 69 72 73 74 20 69 73 | 20 74 6f 20 75 73 65 20 |first is| to use |
|00001df0| 71 75 61 6c 69 66 69 65 | 64 20 69 64 65 6e 74 69 |qualifie|d identi|
|00001e00| 66 69 65 72 73 2c 0d 20 | 20 20 20 20 6f 66 20 74 |fiers,. | of t|
|00001e10| 68 65 20 66 6f 72 6d 61 | 74 20 60 6d 6f 64 75 6c |he forma|t `modul|
|00001e20| 65 5f 5f 6e 61 6d 65 27 | 3a 0d 0d 20 20 20 20 20 |e__name'|:.. |
|00001e30| 20 20 20 20 6d 61 74 63 | 68 20 73 74 61 63 6b 5f | matc|h stack_|
|00001e40| 5f 74 6f 70 28 73 74 61 | 63 6b 5f 5f 70 75 73 68 |_top(sta|ck__push|
|00001e50| 20 31 20 73 74 61 63 6b | 5f 5f 65 6d 70 74 79 29 | 1 stack|__empty)|
|00001e60| 20 77 69 74 68 0d 20 20 | 20 20 20 20 20 20 20 20 | with. | |
|00001e70| 20 20 20 73 74 61 63 6b | 5f 5f 4e 6f 6e 65 20 2d | stack|__None -|
|00001e80| 3e 20 2e 2e 2e 0d 20 20 | 20 20 20 20 20 20 20 20 |> .... | |
|00001e90| 20 7c 20 73 74 61 63 6b | 5f 5f 53 6f 6d 65 20 78 | | stack|__Some x|
|00001ea0| 20 2d 3e 20 2e 2e 2e 0d | 0d 20 20 20 20 20 54 68 | -> ....|. Th|
|00001eb0| 65 20 6f 74 68 65 72 20 | 77 61 79 20 69 73 20 74 |e other |way is t|
|00001ec0| 6f 20 72 65 6c 79 20 6f | 6e 20 61 75 74 6f 6d 61 |o rely o|n automa|
|00001ed0| 74 69 63 20 71 75 61 6c | 69 66 69 63 61 74 69 6f |tic qual|ificatio|
|00001ee0| 6e 20 6f 66 20 69 64 65 | 6e 2d 0d 20 20 20 20 20 |n of ide|n-. |
|00001ef0| 74 69 66 69 65 72 73 2e | 20 20 20 54 68 65 20 73 |tifiers.| The s|
|00001f00| 79 73 74 65 6d 20 6d 61 | 69 6e 74 61 69 6e 73 20 |ystem ma|intains |
|00001f10| 61 20 6c 69 73 74 20 6f | 66 20 22 64 65 66 61 75 |a list o|f "defau|
|00001f20| 6c 74 22 20 6d 6f 64 75 | 6c 65 73 2c 0d 20 20 20 |lt" modu|les,. |
|00001f30| 20 20 63 61 6c 6c 65 64 | 20 20 74 68 65 20 20 63 | called| the c|
|00001f40| 75 72 72 65 6e 74 6c 79 | 20 20 6f 70 65 6e 65 64 |urrently| opened|
|00001f50| 20 20 6d 6f 64 75 6c 65 | 73 2c 20 20 61 6e 64 20 | module|s, and |
|00001f60| 20 77 68 65 6e 65 76 65 | 72 20 20 20 69 74 0d 20 | wheneve|r it. |
|00001f70| 20 20 20 20 65 6e 63 6f | 75 6e 74 65 72 73 20 20 | enco|unters |
|00001f80| 61 6e 20 20 69 64 65 6e | 74 69 66 69 65 72 20 20 |an iden|tifier |
|00001f90| 77 69 74 68 6f 75 74 20 | 20 74 68 65 20 60 6d 6f |without | the `mo|
|00001fa0| 64 75 6c 65 5f 5f 27 20 | 70 61 72 74 2c 20 69 74 |dule__' |part, it|
|00001fb0| 0d 20 20 20 20 20 73 65 | 61 72 63 68 65 73 20 74 |. se|arches t|
|00001fc0| 68 72 6f 75 67 68 20 74 | 68 65 20 20 6f 70 65 6e |hrough t|he open|
|00001fd0| 65 64 20 20 6d 6f 64 75 | 6c 65 73 2c 20 20 74 6f |ed modu|les, to|
|00001fe0| 20 20 66 69 6e 64 20 20 | 77 68 69 63 68 20 20 6f | find |which o|
|00001ff0| 6e 65 0d 20 20 20 20 20 | 64 65 66 69 6e 65 73 20 |ne. |defines |
|00002000| 20 74 68 69 73 20 20 69 | 64 65 6e 74 69 66 69 65 | this i|dentifie|
|00002010| 72 2e 20 20 54 68 65 20 | 69 64 65 6e 74 69 66 69 |r. The |identifi|
|00002020| 65 72 20 69 73 20 74 68 | 65 6e 20 71 75 61 6c 69 |er is th|en quali|
|00002030| 66 69 65 64 0d 20 20 20 | 20 20 77 69 74 68 20 74 |fied. | with t|
|00002040| 68 65 20 6e 61 6d 65 20 | 20 6f 66 20 20 69 74 73 |he name | of its|
|00002050| 20 20 64 65 66 69 6e 69 | 6e 67 20 20 6d 6f 64 75 | defini|ng modu|
|00002060| 6c 65 2e 20 20 53 65 61 | 72 63 68 65 64 20 20 6d |le. Sea|rched m|
|00002070| 6f 64 75 6c 65 73 0d 20 | 20 20 20 20 61 6c 77 61 |odules. | alwa|
|00002080| 79 73 20 20 69 6e 63 6c | 75 64 65 20 20 74 68 65 |ys incl|ude the|
|00002090| 20 6d 6f 64 75 6c 65 20 | 62 65 69 6e 67 20 63 6f | module |being co|
|000020a0| 6d 70 69 6c 65 64 20 28 | 73 65 61 72 63 68 65 64 |mpiled (|searched|
|000020b0| 20 66 69 72 73 74 29 2c | 0d 20 20 20 20 20 61 6e | first),|. an|
|000020c0| 64 20 73 6f 6d 65 20 6c | 69 62 72 61 72 79 20 6d |d some l|ibrary m|
|000020d0| 6f 64 75 6c 65 73 20 6f | 66 20 67 65 6e 65 72 61 |odules o|f genera|
|000020e0| 6c 20 75 73 65 20 28 73 | 65 65 20 74 68 65 20 65 |l use (s|ee the e|
|000020f0| 78 70 6c 61 6e 61 74 69 | 6f 6e 0d 20 20 20 20 20 |xplanati|on. |
|00002100| 66 6f 72 20 74 68 65 20 | 2d 4f 20 66 6c 61 67 20 |for the |-O flag |
|00002110| 61 62 6f 76 65 29 2e 20 | 49 6e 20 61 64 64 69 74 |above). |In addit|
|00002120| 69 6f 6e 2c 20 74 77 6f | 20 64 69 72 65 63 74 69 |ion, two| directi|
|00002130| 76 65 73 20 61 72 65 20 | 70 72 6f 2d 0d 20 20 20 |ves are |pro-. |
|00002140| 20 20 76 69 64 65 64 20 | 74 6f 20 61 64 64 20 61 | vided |to add a|
|00002150| 6e 64 20 74 6f 20 72 65 | 6d 6f 76 65 20 6d 6f 64 |nd to re|move mod|
|00002160| 75 6c 65 73 20 66 72 6f | 6d 20 74 68 65 20 6c 69 |ules fro|m the li|
|00002170| 73 74 20 20 6f 66 20 20 | 6f 70 65 6e 65 64 0d 20 |st of |opened. |
|00002180| 20 20 20 20 6d 6f 64 75 | 6c 65 73 3a 0d 0d 20 20 | modu|les:.. |
|00002190| 20 20 20 20 20 20 20 23 | 6f 70 65 6e 20 22 6d 6f | #|open "mo|
|000021a0| 64 75 6c 65 22 3b 3b 20 | 20 28 2a 20 74 6f 20 61 |dule";; | (* to a|
|000021b0| 64 64 20 22 6d 6f 64 75 | 6c 65 22 2c 20 69 6e 20 |dd "modu|le", in |
|000021c0| 66 72 6f 6e 74 20 2a 29 | 0d 20 20 20 20 20 20 20 |front *)|. |
|000021d0| 20 20 23 63 6c 6f 73 65 | 20 22 6d 6f 64 75 6c 65 | #close| "module|
|000021e0| 22 3b 3b 20 28 2a 20 74 | 6f 20 72 65 6d 6f 76 65 |";; (* t|o remove|
|000021f0| 20 22 6d 6f 64 75 6c 65 | 22 20 2a 29 0d 0d 20 20 | "module|" *).. |
|00002200| 20 20 20 53 6f 20 77 65 | 20 63 61 6e 20 72 65 77 | So we| can rew|
|00002210| 72 69 74 65 20 74 68 65 | 20 65 78 61 6d 70 6c 65 |rite the| example|
|00002220| 20 61 62 6f 76 65 20 61 | 73 3a 0d 0d 20 20 20 20 | above a|s:.. |
|00002230| 20 20 20 20 20 23 6f 70 | 65 6e 20 22 73 74 61 63 | #op|en "stac|
|00002240| 6b 22 3b 3b 0d 0d 20 20 | 20 20 20 20 20 20 20 6d |k";;.. | m|
|00002250| 61 74 63 68 20 74 6f 70 | 28 70 75 73 68 20 31 20 |atch top|(push 1 |
|00002260| 65 6d 70 74 79 29 20 77 | 69 74 68 0d 20 20 20 20 |empty) w|ith. |
|00002270| 20 20 20 20 20 20 20 20 | 20 4e 6f 6e 65 20 2d 3e | | None ->|
|00002280| 20 2e 2e 2e 0d 20 20 20 | 20 20 20 20 20 20 20 20 | .... | |
|00002290| 7c 20 53 6f 6d 65 20 78 | 20 2d 3e 20 2e 2e 2e 0d || Some x| -> ....|
|000022a0| 0d 20 20 20 20 20 49 66 | 20 74 77 6f 20 6d 6f 64 |. If| two mod|
|000022b0| 75 6c 65 73 2c 20 73 61 | 79 20 22 6d 6f 64 31 22 |ules, sa|y "mod1"|
|000022c0| 20 61 6e 64 20 22 6d 6f | 64 32 22 2c 20 64 65 66 | and "mo|d2", def|
|000022d0| 69 6e 65 20 62 6f 74 68 | 20 61 20 20 67 6c 6f 62 |ine both| a glob|
|000022e0| 61 6c 0d 20 20 20 20 20 | 76 61 6c 75 65 2c 20 20 |al. |value, |
|000022f0| 73 61 79 20 20 22 66 22 | 2c 20 20 74 68 65 6e 20 |say "f"|, then |
|00002300| 20 22 66 22 20 20 69 6e | 20 20 61 20 20 63 6c 69 | "f" in| a cli|
|00002310| 65 6e 74 20 20 6d 6f 64 | 75 6c 65 20 22 63 6c 69 |ent mod|ule "cli|
|00002320| 65 6e 74 22 0d 20 20 20 | 20 20 72 65 73 6f 6c 76 |ent". | resolv|
|00002330| 65 73 20 74 6f 20 22 6d | 6f 64 31 5f 5f 66 22 20 |es to "m|od1__f" |
|00002340| 69 66 20 22 6d 6f 64 31 | 22 20 69 73 20 6f 70 65 |if "mod1|" is ope|
|00002350| 6e 65 64 20 62 75 74 20 | 6e 6f 74 20 22 6d 6f 64 |ned but |not "mod|
|00002360| 32 22 2c 20 6f 72 0d 20 | 20 20 20 20 69 66 20 22 |2", or. | if "|
|00002370| 6d 6f 64 31 22 20 68 61 | 73 20 62 65 65 6e 20 6f |mod1" ha|s been o|
|00002380| 70 65 6e 65 64 20 6d 6f | 72 65 20 72 65 63 65 6e |pened mo|re recen|
|00002390| 74 6c 79 20 74 68 61 6e | 20 22 6d 6f 64 32 22 2e |tly than| "mod2".|
|000023a0| 0d 0d 0d 0d 54 48 45 20 | 53 54 41 4e 44 41 52 44 |....THE |STANDARD|
|000023b0| 20 4c 49 42 52 41 52 59 | 0d 20 20 20 20 20 41 20 | LIBRARY|. A |
|000023c0| 6e 75 6d 62 65 72 20 6f | 66 20 70 72 69 6d 69 74 |number o|f primit|
|000023d0| 69 76 65 73 20 61 6e 64 | 20 70 72 65 64 65 66 69 |ives and| predefi|
|000023e0| 6e 65 64 20 66 75 6e 63 | 74 69 6f 6e 73 20 20 61 |ned func|tions a|
|000023f0| 72 65 20 20 61 76 61 69 | 6c 2d 0d 20 20 20 20 20 |re avai|l-. |
|00002400| 61 62 6c 65 20 20 74 6f | 20 20 74 68 65 20 75 73 |able to| the us|
|00002410| 65 72 2e 20 54 68 65 79 | 20 61 72 65 20 64 6f 63 |er. They| are doc|
|00002420| 75 6d 65 6e 74 65 64 20 | 69 6e 20 74 68 65 20 2e |umented |in the .|
|00002430| 6d 6c 69 20 66 69 6c 65 | 73 20 69 6e 0d 20 20 20 |mli file|s in. |
|00002440| 20 20 74 68 65 20 20 20 | 6c 69 62 72 61 72 79 20 | the |library |
|00002450| 20 20 64 69 72 65 63 74 | 6f 72 79 20 20 20 28 75 | direct|ory (u|
|00002460| 73 75 61 6c 6c 79 20 20 | 20 22 4d 61 63 69 6e 74 |sually | "Macint|
|00002470| 6f 73 68 20 20 20 20 48 | 44 3a 43 61 6d 6c 0d 20 |osh H|D:Caml. |
|00002480| 20 20 20 20 4c 69 67 68 | 74 3a 4c 69 62 3a 22 29 | Ligh|t:Lib:")|
|00002490| 2e 20 20 20 53 6f 6d 65 | 20 20 20 6f 66 20 20 74 |. Some| of t|
|000024a0| 68 65 73 65 20 20 6c 69 | 62 72 61 72 69 65 73 20 |hese li|braries |
|000024b0| 20 61 72 65 20 20 69 6d | 70 6c 69 63 69 74 6c 79 | are im|plicitly|
|000024c0| 0d 20 20 20 20 20 22 6f | 70 65 6e 65 64 22 20 61 |. "o|pened" a|
|000024d0| 74 20 74 68 65 20 62 65 | 67 69 6e 6e 69 6e 67 20 |t the be|ginning |
|000024e0| 6f 66 20 61 20 63 6f 6d | 70 69 6c 61 74 69 6f 6e |of a com|pilation|
|000024f0| 2c 20 20 61 6e 64 20 20 | 69 6d 70 6c 69 63 69 74 |, and |implicit|
|00002500| 6c 79 0d 20 20 20 20 20 | 6c 69 6e 6b 65 64 20 77 |ly. |linked w|
|00002510| 69 74 68 20 74 68 65 20 | 75 73 65 72 27 73 20 6f |ith the |user's o|
|00002520| 62 6a 65 63 74 20 63 6f | 64 65 2e 20 57 69 74 68 |bject co|de. With|
|00002530| 6f 75 74 20 74 68 65 20 | 22 2d 4f 22 20 6f 70 74 |out the |"-O" opt|
|00002540| 69 6f 6e 2c 0d 20 20 20 | 20 20 6f 72 20 77 69 74 |ion,. | or wit|
|00002550| 68 20 22 2d 4f 20 63 61 | 75 74 69 6f 75 73 22 2c |h "-O ca|utious",|
|00002560| 20 74 68 65 20 64 65 66 | 61 75 6c 74 20 6d 6f 64 | the def|ault mod|
|00002570| 75 6c 65 73 20 61 72 65 | 3a 0d 0d 20 20 20 20 20 |ules are|:.. |
|00002580| 20 20 20 20 65 78 63 20 | 20 62 6f 6f 6c 20 20 63 | exc | bool c|
|00002590| 73 74 72 69 6e 67 20 20 | 63 63 68 61 72 20 20 63 |string |cchar c|
|000025a0| 76 65 63 74 20 20 6c 69 | 73 74 0d 20 20 20 20 20 |vect li|st. |
|000025b0| 20 20 20 20 70 61 69 72 | 20 20 72 65 66 20 20 66 | pair| ref f|
|000025c0| 6c 6f 61 74 20 20 69 6e | 74 20 20 65 71 20 20 69 |loat in|t eq i|
|000025d0| 6f 0d 0d 20 20 20 20 20 | 57 69 74 68 20 22 2d 4f |o.. |With "-O|
|000025e0| 20 66 61 73 74 22 2c 20 | 74 68 65 20 64 65 66 61 | fast", |the defa|
|000025f0| 75 6c 74 20 6d 6f 64 75 | 6c 65 73 20 61 72 65 3a |ult modu|les are:|
|00002600| 0d 0d 20 20 20 20 20 20 | 20 20 20 65 78 63 20 20 |.. | exc |
|00002610| 62 6f 6f 6c 20 20 66 73 | 74 72 69 6e 67 20 20 66 |bool fs|tring f|
|00002620| 63 68 61 72 20 20 66 76 | 65 63 74 20 20 6c 69 73 |char fv|ect lis|
|00002630| 74 0d 20 20 20 20 20 20 | 20 20 20 70 61 69 72 20 |t. | pair |
|00002640| 20 72 65 66 20 20 66 6c | 6f 61 74 20 20 69 6e 74 | ref fl|oat int|
|00002650| 20 20 65 71 20 20 69 6f | 0d 0d 0d 0d 4d 41 49 4e | eq io|....MAIN|
|00002660| 20 44 49 46 46 45 52 45 | 4e 43 45 53 20 57 49 54 | DIFFERE|NCES WIT|
|00002670| 48 20 43 41 4d 4c 0d 20 | 20 20 20 20 43 41 4d 4c |H CAML. | CAML|
|00002680| 20 4c 69 67 68 74 20 69 | 73 20 62 61 73 65 64 20 | Light i|s based |
|00002690| 20 75 70 6f 6e 20 20 43 | 41 4d 4c 20 20 56 32 2e | upon C|AML V2.|
|000026a0| 36 2e 31 2e 20 20 54 68 | 65 20 20 6d 61 69 6e 20 |6.1. Th|e main |
|000026b0| 20 6d 69 73 73 69 6e 67 | 0d 20 20 20 20 20 66 65 | missing|. fe|
|000026c0| 61 74 75 72 65 73 20 20 | 61 72 65 20 20 67 72 61 |atures |are gra|
|000026d0| 6d 6d 61 72 73 2c 20 20 | 6f 76 65 72 6c 6f 61 64 |mmars, |overload|
|000026e0| 69 6e 67 2c 20 20 61 6e | 64 20 22 6c 61 7a 79 22 |ing, an|d "lazy"|
|000026f0| 20 64 61 74 61 20 63 6f | 6e 2d 0d 20 20 20 20 20 | data co|n-. |
|00002700| 73 74 72 75 63 74 6f 72 | 73 2e 20 54 68 65 20 6d |structor|s. The m|
|00002710| 61 69 6e 20 64 69 66 66 | 65 72 65 6e 63 65 73 20 |ain diff|erences |
|00002720| 77 69 74 68 20 56 32 2e | 36 2e 31 20 61 72 65 3a |with V2.|6.1 are:|
|00002730| 0d 0d 20 20 20 20 20 31 | 29 20 20 20 44 61 74 61 |.. 1|) Data|
|00002740| 20 63 6f 6e 73 74 72 75 | 63 74 6f 72 73 20 61 72 | constru|ctors ar|
|00002750| 65 20 20 6e 2d 61 72 79 | 2c 20 20 69 6e 73 74 65 |e n-ary|, inste|
|00002760| 61 64 20 20 6f 66 20 20 | 6e 75 6c 6c 61 72 79 20 |ad of |nullary |
|00002770| 20 6f 72 0d 20 20 20 20 | 20 20 20 20 20 20 75 6e | or. | un|
|00002780| 61 72 79 2e 20 45 2e 67 | 2e 20 69 6e 0d 0d 20 20 |ary. E.g|. in.. |
|00002790| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000027a0| 74 79 70 65 20 66 6f 6f | 20 3d 20 41 20 6f 66 20 |type foo| = A of |
|000027b0| 69 6e 74 20 2a 20 69 6e | 74 20 7c 20 2e 2e 2e 0d |int * in|t | ....|
|000027c0| 0d 20 20 20 20 20 20 20 | 20 20 20 41 20 69 73 20 |. | A is |
|000027d0| 69 6e 74 65 72 70 72 65 | 74 65 64 20 61 73 20 61 |interpre|ted as a|
|000027e0| 20 63 6f 6e 73 74 72 75 | 63 74 6f 72 20 74 61 6b | constru|ctor tak|
|000027f0| 69 6e 67 20 74 77 6f 20 | 61 72 67 75 6d 65 6e 74 |ing two |argument|
|00002800| 73 2c 0d 20 20 20 20 20 | 20 20 20 20 20 6e 6f 74 |s,. | not|
|00002810| 20 20 61 73 20 20 61 20 | 63 6f 6e 73 74 72 75 63 | as a |construc|
|00002820| 74 6f 72 20 74 61 6b 69 | 6e 67 20 6f 6e 65 20 61 |tor taki|ng one a|
|00002830| 72 67 75 6d 65 6e 74 20 | 74 68 61 74 20 68 61 70 |rgument |that hap|
|00002840| 70 65 6e 73 0d 20 20 20 | 20 20 20 20 20 20 20 74 |pens. | t|
|00002850| 6f 20 62 65 20 61 20 70 | 61 69 72 2e 20 20 54 68 |o be a p|air. Th|
|00002860| 65 72 65 66 6f 72 65 2c | 20 20 6e 6f 6e 65 20 20 |erefore,| none |
|00002870| 6f 66 20 20 74 68 65 20 | 20 66 6f 6c 6c 6f 77 69 |of the | followi|
|00002880| 6e 67 20 20 69 73 0d 20 | 20 20 20 20 20 20 20 20 |ng is. | |
|00002890| 20 61 6c 6c 6f 77 65 64 | 20 69 6e 20 43 41 4d 4c | allowed| in CAML|
|000028a0| 20 4c 69 67 68 74 3a 0d | 0d 20 20 20 20 20 20 20 | Light:.|. |
|000028b0| 20 20 20 20 20 20 20 20 | 20 20 20 6c 65 74 20 78 | | let x|
|000028c0| 20 3d 20 28 31 2c 32 29 | 20 69 6e 20 41 20 78 0d | = (1,2)| in A x.|
|000028d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000028e0| 20 20 66 75 6e 63 74 69 | 6f 6e 20 41 20 7a 20 2d | functi|on A z -|
|000028f0| 3e 20 2e 2e 2e 0d 0d 20 | 20 20 20 20 20 20 20 20 |> ..... | |
|00002900| 20 73 69 6e 63 65 20 69 | 74 20 74 72 65 61 74 73 | since i|t treats|
|00002910| 20 41 20 61 73 20 69 66 | 20 69 74 20 77 65 72 65 | A as if| it were|
|00002920| 20 6f 66 20 20 61 72 69 | 74 79 20 20 31 2e 20 20 | of ari|ty 1. |
|00002930| 42 75 74 20 20 74 68 65 | 0d 20 20 20 20 20 20 20 |But the|. |
|00002940| 20 20 20 66 6f 6c 6c 6f | 77 69 6e 67 20 69 73 20 | follo|wing is |
|00002950| 4f 4b 3a 0d 0d 20 20 20 | 20 20 20 20 20 20 20 20 |OK:.. | |
|00002960| 20 20 20 20 20 20 20 41 | 28 31 2c 32 29 0d 20 20 | A|(1,2). |
|00002970| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002980| 66 75 6e 63 74 69 6f 6e | 20 41 28 78 2c 79 29 20 |function| A(x,y) |
|00002990| 2d 3e 20 2e 2e 2e 0d 0d | 20 20 20 20 20 32 29 20 |-> .....| 2) |
|000029a0| 20 20 54 75 70 6c 65 73 | 20 61 72 65 20 6e 6f 74 | Tuples| are not|
|000029b0| 20 62 75 69 6c 74 20 6f | 75 74 20 6f 66 20 70 61 | built o|ut of pa|
|000029c0| 69 72 73 2e 20 45 2e 67 | 2e 20 20 28 31 2c 32 2c |irs. E.g|. (1,2,|
|000029d0| 33 29 20 20 69 73 20 20 | 61 0d 20 20 20 20 20 20 |3) is |a. |
|000029e0| 20 20 20 20 22 72 65 61 | 6c 22 20 20 74 72 69 70 | "rea|l" trip|
|000029f0| 6c 65 2c 20 6e 6f 74 20 | 74 68 65 20 70 61 69 72 |le, not |the pair|
|00002a00| 20 28 31 2c 20 28 32 2c | 33 29 29 2e 20 48 65 6e | (1, (2,|3)). Hen|
|00002a10| 63 65 20 74 68 65 20 66 | 6f 6c 2d 0d 20 20 20 20 |ce the f|ol-. |
|00002a20| 20 20 20 20 20 20 6c 6f | 77 69 6e 67 20 69 73 20 | lo|wing is |
|00002a30| 69 6c 6c 2d 74 79 70 65 | 64 20 69 6e 20 43 41 4d |ill-type|d in CAM|
|00002a40| 4c 20 4c 69 67 68 74 3a | 0d 0d 20 20 20 20 20 20 |L Light:|.. |
|00002a50| 20 20 20 20 20 20 20 20 | 20 20 20 20 6d 61 74 63 | | matc|
|00002a60| 68 20 28 31 2c 32 2c 33 | 29 20 77 69 74 68 20 28 |h (1,2,3|) with (|
|00002a70| 78 2c 79 29 20 2d 3e 20 | 79 0d 0d 20 20 20 20 20 |x,y) -> |y.. |
|00002a80| 20 20 20 20 20 79 6f 75 | 20 73 68 6f 75 6c 64 20 | you| should |
|00002a90| 64 6f 20 69 6e 73 74 65 | 61 64 3a 0d 0d 20 20 20 |do inste|ad:.. |
|00002aa0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 6d | | m|
|00002ab0| 61 74 63 68 20 28 31 2c | 32 2c 33 29 20 77 69 74 |atch (1,|2,3) wit|
|00002ac0| 68 20 28 78 2c 79 2c 7a | 29 20 2d 3e 20 28 79 2c |h (x,y,z|) -> (y,|
|00002ad0| 7a 29 0d 0d 20 20 20 20 | 20 33 29 20 20 20 4e 6f |z).. | 3) No|
|00002ae0| 20 22 6e 75 6d 22 20 74 | 79 70 65 2c 20 6e 6f 72 | "num" t|ype, nor|
|00002af0| 20 72 61 74 69 6f 6e 61 | 6c 73 2c 20 6e 6f 72 20 | rationa|ls, nor |
|00002b00| 62 69 67 20 69 6e 74 65 | 67 65 72 73 2e 20 20 59 |big inte|gers. Y|
|00002b10| 6f 75 27 6c 6c 0d 20 20 | 20 20 20 20 20 20 20 20 |ou'll. | |
|00002b20| 68 61 76 65 20 20 74 6f | 20 20 64 6f 20 20 77 69 |have to| do wi|
|00002b30| 74 68 20 69 6e 74 65 67 | 65 72 73 20 61 6e 64 20 |th integ|ers and |
|00002b40| 66 6c 6f 61 74 69 6e 67 | 2d 70 6f 69 6e 74 20 6e |floating|-point n|
|00002b50| 75 6d 62 65 72 73 2e 0d | 20 20 20 20 20 20 20 20 |umbers..| |
|00002b60| 20 20 54 68 65 20 6e 65 | 65 64 20 66 6f 72 20 74 | The ne|ed for t|
|00002b70| 68 65 20 22 6e 75 6d 22 | 20 74 79 70 65 20 73 68 |he "num"| type sh|
|00002b80| 6f 75 6c 64 20 62 65 20 | 6c 65 73 73 20 20 61 63 |ould be |less ac|
|00002b90| 75 74 65 20 20 74 68 61 | 6e 0d 20 20 20 20 20 20 |ute tha|n. |
|00002ba0| 20 20 20 20 69 6e 20 43 | 41 4d 4c 2c 20 62 65 63 | in C|AML, bec|
|00002bb0| 61 75 73 65 20 69 6e 74 | 65 67 65 72 73 20 61 72 |ause int|egers ar|
|00002bc0| 65 20 33 31 2d 62 69 74 | 20 77 69 64 65 2e 0d 0d |e 31-bit| wide...|
|00002bd0| 20 20 20 20 20 34 29 20 | 20 20 43 75 72 72 69 65 | 4) | Currie|
|00002be0| 64 20 70 61 74 74 65 72 | 6e 2d 6d 61 74 63 68 69 |d patter|n-matchi|
|00002bf0| 6e 67 20 77 6f 72 6b 73 | 20 64 69 66 66 65 72 65 |ng works| differe|
|00002c00| 6e 74 6c 79 3a 20 6d 61 | 74 63 68 69 6e 67 20 69 |ntly: ma|tching i|
|00002c10| 73 0d 20 20 20 20 20 20 | 20 20 20 20 70 65 72 66 |s. | perf|
|00002c20| 6f 72 6d 65 64 20 20 6f | 6e 63 65 2c 20 77 68 65 |ormed o|nce, whe|
|00002c30| 6e 20 61 6c 6c 20 61 72 | 67 75 6d 65 6e 74 73 20 |n all ar|guments |
|00002c40| 61 72 65 20 67 61 74 68 | 65 72 65 64 2e 20 48 65 |are gath|ered. He|
|00002c50| 6e 63 65 0d 20 20 20 20 | 20 20 20 20 20 20 69 74 |nce. | it|
|00002c60| 20 77 6f 72 6b 73 20 65 | 78 61 63 74 6c 79 20 61 | works e|xactly a|
|00002c70| 73 20 69 66 20 74 68 65 | 20 6d 61 74 63 68 69 6e |s if the| matchin|
|00002c80| 67 20 77 65 72 65 20 75 | 6e 63 75 72 72 69 65 64 |g were u|ncurried|
|00002c90| 2e 20 20 49 6e 0d 20 20 | 20 20 20 20 20 20 20 20 |. In. | |
|00002ca0| 43 41 4d 4c 3a 0d 0d 20 | 20 20 20 20 20 20 20 20 |CAML:.. | |
|00002cb0| 20 20 20 20 20 20 6c 65 | 74 20 66 20 3d 20 66 75 | le|t f = fu|
|00002cc0| 6e 20 5b 5d 20 78 20 2d | 3e 20 78 0d 20 20 20 20 |n [] x -|> x. |
|00002cd0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002ce0| 20 20 20 20 20 20 20 20 | 7c 20 78 20 5b 5d 20 2d | || x [] -|
|00002cf0| 3e 20 78 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |> x. | |
|00002d00| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002d10| 7c 20 28 61 3a 3a 62 29 | 20 28 63 3a 3a 64 29 20 || (a::b)| (c::d) |
|00002d20| 2d 3e 20 62 0d 20 20 20 | 20 20 20 20 20 20 20 20 |-> b. | |
|00002d30| 20 20 20 20 20 20 20 69 | 6e 20 66 20 5b 31 5d 20 | i|n f [1] |
|00002d40| 5b 32 5d 0d 0d 20 20 20 | 20 20 20 20 20 20 20 6a |[2].. | j|
|00002d50| 75 73 74 20 66 61 69 6c | 73 2c 20 62 65 63 61 75 |ust fail|s, becau|
|00002d60| 73 65 20 69 74 20 69 73 | 20 74 72 65 61 74 65 64 |se it is| treated|
|00002d70| 20 61 73 3a 0d 0d 20 20 | 20 20 20 20 20 20 20 20 | as:.. | |
|00002d80| 20 20 20 20 20 20 20 20 | 6c 65 74 20 66 20 3d 20 | |let f = |
|00002d90| 66 75 6e 20 5b 5d 20 2d | 3e 20 28 66 75 6e 20 78 |fun [] -|> (fun x|
|00002da0| 20 2d 3e 20 78 29 0d 20 | 20 20 20 20 20 20 20 20 | -> x). | |
|00002db0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002dc0| 20 20 20 7c 20 78 20 20 | 2d 3e 20 28 66 75 6e 20 | | x |-> (fun |
|00002dd0| 5b 5d 20 2d 3e 20 78 29 | 0d 20 20 20 20 20 20 20 |[] -> x)|. |
|00002de0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002df0| 20 20 20 20 20 7c 20 28 | 61 3a 3a 62 29 20 2d 3e | | (|a::b) ->|
|00002e00| 20 28 66 75 6e 20 28 63 | 3a 3a 64 29 20 2d 3e 20 | (fun (c|::d) -> |
|00002e10| 62 29 0d 0d 20 20 20 20 | 20 20 20 20 20 20 77 68 |b).. | wh|
|00002e20| 69 6c 65 20 69 6e 20 43 | 41 4d 4c 20 4c 69 67 68 |ile in C|AML Ligh|
|00002e30| 74 2c 20 69 74 20 73 65 | 6c 65 63 74 73 20 74 68 |t, it se|lects th|
|00002e40| 65 20 74 68 69 72 64 20 | 63 61 73 65 20 20 6f 66 |e third |case of|
|00002e50| 20 20 74 68 65 0d 20 20 | 20 20 20 20 20 20 20 20 | the. | |
|00002e60| 6d 61 74 63 68 69 6e 67 | 2c 20 61 73 20 69 74 20 |matching|, as it |
|00002e70| 73 68 6f 75 6c 64 20 64 | 6f 2e 0d 0d 0d 0d 46 49 |should d|o.....FI|
|00002e80| 4c 45 53 0d 20 20 20 20 | 20 22 4d 61 63 69 6e 74 |LES. | "Macint|
|00002e90| 6f 73 68 20 48 44 3a 43 | 61 6d 6c 20 4c 69 67 68 |osh HD:C|aml Ligh|
|00002ea0| 74 3a 4c 69 62 3a 22 20 | 20 20 20 20 73 74 61 6e |t:Lib:" | stan|
|00002eb0| 64 61 72 64 20 6c 69 62 | 72 61 72 79 0d 20 20 20 |dard lib|rary. |
|00002ec0| 20 20 43 61 6d 6c 52 75 | 6e 20 20 20 20 20 20 20 | CamlRu|n |
|00002ed0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002ee0| 20 20 20 20 20 74 68 65 | 20 62 79 74 65 63 6f 64 | the| bytecod|
|00002ef0| 65 20 69 6e 74 65 72 70 | 72 65 74 65 72 0d 20 20 |e interp|reter. |
|00002f00| 20 20 20 43 61 6d 6c 63 | 20 20 20 20 20 20 20 20 | Camlc| |
|00002f10| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002f20| 20 20 20 20 20 20 74 68 | 65 20 63 6f 6d 70 69 6c | th|e compil|
|00002f30| 65 72 0d 20 20 20 20 20 | 43 61 6d 6c 20 20 20 20 |er. |Caml |
|00002f40| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002f50| 20 20 20 20 20 20 20 20 | 20 20 20 74 68 65 20 74 | | the t|
|00002f60| 6f 70 6c 65 76 65 6c 0d | 0d 0d 42 55 47 53 0d 20 |oplevel.|..BUGS. |
|00002f70| 20 20 20 20 54 68 65 72 | 65 20 61 72 65 20 76 65 | Ther|e are ve|
|00002f80| 72 79 20 66 65 77 20 64 | 65 62 75 67 67 69 6e 67 |ry few d|ebugging|
|00002f90| 20 74 6f 6f 6c 73 2e 0d | 0d 20 20 20 20 20 50 6f | tools..|. Po|
|00002fa0| 6c 79 6d 6f 72 70 68 69 | 63 20 72 65 66 65 72 65 |lymorphi|c refere|
|00002fb0| 6e 63 65 73 2c 20 61 6e | 64 20 6d 6f 72 65 20 67 |nces, an|d more g|
|00002fc0| 65 6e 65 72 61 6c 6c 79 | 20 6d 75 74 61 62 6c 65 |enerally| mutable|
|00002fd0| 20 20 63 6f 6e 63 72 65 | 74 65 0d 20 20 20 20 20 | concre|te. |
|00002fe0| 74 79 70 65 73 2c 20 20 | 61 72 65 20 20 6e 6f 74 |types, |are not|
|00002ff0| 20 20 73 61 66 65 3a 20 | 69 74 20 69 73 20 70 6f | safe: |it is po|
|00003000| 73 73 69 62 6c 65 20 74 | 6f 20 63 72 65 61 74 65 |ssible t|o create|
|00003010| 20 70 6f 6c 79 6d 6f 72 | 70 68 69 63 0d 20 20 20 | polymor|phic. |
|00003020| 20 20 72 65 66 65 72 65 | 6e 63 65 73 20 20 74 68 | refere|nces th|
|00003030| 72 6f 75 67 68 20 20 61 | 20 20 66 75 6e 63 74 69 |rough a| functi|
|00003040| 6f 6e 61 6c 20 20 65 6e | 63 6f 64 69 6e 67 3b 20 |onal en|coding; |
|00003050| 20 61 6e 64 20 20 70 61 | 74 74 65 72 6e 2d 0d 20 | and pa|ttern-. |
|00003060| 20 20 20 20 6d 61 74 63 | 68 69 6e 67 20 6f 6e 20 | matc|hing on |
|00003070| 6d 75 74 61 62 6c 65 20 | 73 74 72 75 63 74 75 72 |mutable |structur|
|00003080| 65 73 20 69 73 20 6e 6f | 74 20 63 6f 6d 70 69 6c |es is no|t compil|
|00003090| 65 64 20 63 6f 72 72 65 | 63 74 6c 79 2e 0d 0d 20 |ed corre|ctly... |
|000030a0| 20 20 20 20 53 74 72 75 | 63 74 75 72 65 64 20 69 | Stru|ctured i|
|000030b0| 6e 70 75 74 2f 6f 75 74 | 70 75 74 20 69 73 20 6e |nput/out|put is n|
|000030c0| 6f 74 20 74 79 70 65 2d | 73 61 66 65 3b 20 20 6e |ot type-|safe; n|
|000030d0| 6f 74 68 69 6e 67 20 20 | 70 72 65 76 65 6e 74 73 |othing |prevents|
|000030e0| 0d 20 20 20 20 20 74 68 | 65 20 20 75 73 65 72 20 |. th|e user |
|000030f0| 20 66 72 6f 6d 20 77 72 | 69 74 69 6e 67 20 64 61 | from wr|iting da|
|00003100| 74 61 20 6f 66 20 6f 6e | 65 20 74 79 70 65 20 61 |ta of on|e type a|
|00003110| 6e 64 20 72 65 61 64 69 | 6e 67 20 69 74 20 77 69 |nd readi|ng it wi|
|00003120| 74 68 0d 20 20 20 20 20 | 61 6e 6f 74 68 65 72 20 |th. |another |
|00003130| 74 79 70 65 2e 0d 0d 20 | 20 20 20 20 56 61 72 69 |type... | Vari|
|00003140| 6f 75 73 20 73 69 7a 65 | 20 6c 69 6d 69 74 61 74 |ous size| limitat|
|00003150| 69 6f 6e 73 20 61 72 65 | 20 6e 6f 74 20 63 68 65 |ions are| not che|
|00003160| 63 6b 65 64 20 20 62 79 | 20 20 74 68 65 20 20 63 |cked by| the c|
|00003170| 6f 6d 70 69 6c 65 72 3a | 0d 20 20 20 20 20 74 68 |ompiler:|. th|
|00003180| 65 20 20 73 69 7a 65 20 | 20 6f 66 20 61 20 6c 6f |e size | of a lo|
|00003190| 63 61 6c 20 65 6e 76 69 | 72 6f 6e 6d 65 6e 74 20 |cal envi|ronment |
|000031a0| 73 68 6f 75 6c 64 20 6e | 6f 74 20 65 78 63 65 65 |should n|ot excee|
|000031b0| 64 20 32 35 36 3b 20 74 | 68 65 0d 20 20 20 20 20 |d 256; t|he. |
|000031c0| 6e 75 6d 62 65 72 20 6f | 66 20 63 6f 6e 73 74 72 |number o|f constr|
|000031d0| 75 63 74 6f 72 73 20 69 | 6e 20 61 20 63 6f 6e 63 |uctors i|n a conc|
|000031e0| 72 65 74 65 20 74 79 70 | 65 20 73 68 6f 75 6c 64 |rete typ|e should|
|000031f0| 20 6e 6f 74 20 20 65 78 | 63 65 65 64 0d 20 20 20 | not ex|ceed. |
|00003200| 20 20 32 35 33 3b 20 20 | 74 68 65 20 6e 75 6d 62 | 253; |the numb|
|00003210| 65 72 20 6f 66 20 67 6c | 6f 62 61 6c 20 76 61 6c |er of gl|obal val|
|00003220| 75 65 73 20 73 68 6f 75 | 6c 64 20 62 65 20 6c 65 |ues shou|ld be le|
|00003230| 73 73 20 74 68 61 6e 20 | 36 35 35 33 36 3b 0d 20 |ss than |65536;. |
|00003240| 20 20 20 20 65 74 63 2e | 0d 0d 20 20 20 20 20 54 | etc.|.. T|
|00003250| 68 65 20 6d 6f 64 75 6c | 65 20 73 79 73 74 65 6d |he modul|e system|
|00003260| 20 69 73 20 6e 6f 74 20 | 66 6f 6f 6c 70 72 6f 6f | is not |foolproo|
|00003270| 66 2c 20 73 69 6e 63 65 | 20 69 74 20 72 65 6c 69 |f, since| it reli|
|00003280| 65 73 20 20 6f 6e 20 20 | 74 68 65 0d 20 20 20 20 |es on |the. |
|00003290| 20 28 62 61 73 65 29 20 | 20 6e 61 6d 65 73 20 20 | (base) | names |
|000032a0| 6f 66 20 74 68 65 20 66 | 69 6c 65 73 2e 20 41 6e |of the f|iles. An|
|000032b0| 79 74 68 69 6e 67 20 63 | 61 6e 20 68 61 70 70 65 |ything c|an happe|
|000032c0| 6e 20 69 66 20 74 68 65 | 20 75 73 65 72 0d 20 20 |n if the| user. |
|000032d0| 20 20 20 6d 6f 6e 6b 65 | 79 73 20 77 69 74 68 20 | monke|ys with |
|000032e0| 74 68 65 20 69 6e 74 65 | 72 66 61 63 65 20 70 61 |the inte|rface pa|
|000032f0| 74 68 2c 20 6f 72 20 72 | 65 6e 61 6d 65 73 20 63 |th, or r|enames c|
|00003300| 6f 6d 70 69 6c 65 64 20 | 20 69 6e 74 65 72 2d 0d |ompiled | inter-.|
|00003310| 20 20 20 20 20 66 61 63 | 65 73 2e 0d 00 00 00 00 | fac|es......|
|00003320| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003330| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003340| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003350| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003380| 00 00 01 00 00 00 01 4c | 00 00 00 4c 00 00 00 32 |.......L|...L...2|
|00003390| 76 65 0d 09 44 69 72 65 | 63 74 6f 72 79 20 6b 62 |ve..Dire|ctory kb|
|000033a0| 3b 20 4d 61 6b 65 20 61 | 6c 6c 0d 0d 73 63 72 61 |; Make a|ll..scra|
|000033b0| 07 6d 61 6e 70 61 67 65 | 02 00 00 00 54 45 58 54 |.manpage|....TEXT|
|000033c0| 4d 50 53 20 01 00 00 40 | 00 40 00 00 00 00 1b 50 |MPS ...@|.@.....P|
|000033d0| 00 00 54 45 58 54 4d 50 | 53 20 01 00 00 40 00 40 |..TEXTMP|S ...@.@|
|000033e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 19 0a 00 00 |........|........|
|000033f0| 00 00 a4 61 84 dd 00 00 | 32 9c 00 00 01 7e 09 63 |...a....|2....~.c|
|00003400| 61 6d 6c 63 20 2d 6f 20 | 66 69 62 20 66 69 62 2e |amlc -o |fib fib.|
|00003410| 6d 6c 0d 0d 77 63 20 c4 | 20 77 63 2e 6d 6c 0d 09 |ml..wc .| wc.ml..|
|00003420| 63 61 6d 6c 63 20 2d 6f | 20 77 63 20 77 63 2e 6d |camlc -o| wc wc.m|
|00003430| 6c 0d 0d 73 69 65 76 65 | 20 c4 20 73 69 65 76 65 |l..sieve| . sieve|
|00003440| 2e 6d 6c 0d 09 63 61 6d | 6c 63 20 2d 6f 20 73 69 |.ml..cam|lc -o si|
|00003450| 65 76 65 20 73 69 65 76 | 65 2e 6d 6c 0d 0d 6f 63 |eve siev|e.ml..oc|
|00003460| 61 6c 69 73 61 74 69 6f | 6e 20 64 75 20 66 69 63 |alisatio|n du fic|
|00003470| 68 69 65 72 20 65 73 74 | 20 63 6f 6e 6e 75 65 3b |hier est| connue;|
|00003480| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 00 00 |...H..Mo|naco....|
|00003490| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000034a0| 00 00 00 00 00 00 00 06 | 00 04 00 2a 00 03 01 53 |........|...*...S|
|000034b0| 01 ad 00 2a 00 03 01 53 | 01 ad a4 61 84 dd 00 00 |...*...S|...a....|
|000034c0| 00 00 00 00 00 00 00 00 | 00 00 01 00 00 00 01 00 |........|........|
|000034d0| 00 00 01 4c 00 00 00 4c | 00 00 00 32 00 54 c7 3c |...L...L|...2.T.<|
|000034e0| 05 26 00 00 00 1c 00 32 | 00 00 4d 50 53 52 00 00 |.&.....2|..MPSR..|
|000034f0| 00 0a 03 ed ff ff 00 00 | 00 00 00 56 6e 40 00 00 |........|...Vn@..|
+--------+-------------------------+-------------------------+--------+--------+